Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I was suggested the following code to programmatically render SSRS report in PDF format.
I tried it but it is not working.

Can any body suggest what might be required?
Thanks

VB
Dim format As String = "PDF"
        Dim fileName As String = "C:\Output.pdf"
         Dim reportPath As String = "/[Report Folder]/Invoice"

        ' Prepare Render arguments
        Dim historyID As String = Nothing
        Dim deviceInfo As String = Nothing
        Dim extension As String = Nothing
        Dim encoding As String
        Dim mimeType As String = "application/pdf"
        Dim warnings() As Microsoft.Reporting.WinForms.Warning = Nothing
        Dim streamIDs() As String = Nothing
        Dim results() As Byte

        ReportViewer1.LocalReport.Render(format, deviceInfo, mimeType, encoding, fileName, streamIDs, warnings)

      
        ' Open a file stream and write out the report
        Dim stream As FileStream = File.OpenWrite(fileName)
        stream.Write(results, 0, results.Length)
        stream.Close()
Posted
Comments
[no name] 29-Mar-14 9:17am    
"is not working" is not at all helpful when describing technical issues. Debug your code, find out what is causing whatever your problem is and fix it.

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