Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
VB
Imports SSRS_TO_PDF.ReportingServiceWebReference
Imports System.IO
Imports System.Web.Services.Protocols

Module Module1

    Sub Main()
        Dim RS As New ReportingServiceWebReference.ReportingService2010
        Dim ex As New ReportingService2010
        RS.Credentials = System.Net.CredentialCache.DefaultCredentials
    

        'RS.Credentials = System.Net.CredentialCache.DefaultCredentials

        Dim reportName As String = "http://192.168.108.23/Reports/Pages/Report.aspx?ItemPath=%2fGROW%2fUser_Tb_Server_Check"
        Dim reportDefinition As Byte() = Nothing
        Dim doc As New System.Xml.XmlDocument

        Try
            reportDefinition = RS.GetItemDefinition(reportName)
            Dim stream As New MemoryStream(reportDefinition)
            'write to pdf file
            Dim file As New FileStream("C:\Temp\TestReport3.PDF", FileMode.Create, FileAccess.Write)
            stream.WriteTo(file)
            file.Close()
            stream.Close()

        Catch e As SoapException
            Console.WriteLine(e.Detail.InnerXml.ToString())
            MsgBox(e.ToString)
        Catch e As IOException
            Console.WriteLine(e.Message)
        End Try

    End Sub

End Module
Posted
Updated 5-Nov-15 6:37am
v2
Comments
Richard Deeming 5-Nov-15 11:24am    
Failing how?

Use the "Improve question" button to update your question with the full details of the exception you're getting.

While you're at it, wrap your code in <pre>...</pre> tags so that it's properly formatted.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900