Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I get the following error while running the below code. Please help.
An unhandled exception of type 'Microsoft.Reporting.WinForms.LocalProcessingException' occurred in Microsoft.ReportViewer.WinForms.dll

Additional information: An error occurred during local report processing.

VB
Private Sub btnPDF2_Click(sender As Object, e As EventArgs) Handles btnPDF2.Click
       Dim warnings As Warning() = Nothing
       Dim streamids As String() = Nothing
       Dim mimeType As String = Nothing
       Dim encoding As String = Nothing
       Dim extension As String = Nothing
       Dim bytes As Byte()


       Dim ReportViewer3 As New Microsoft.Reporting.WinForms.ReportViewer()
       Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
       ReportViewer3.ProcessingMode = ProcessingMode.Local

       ReportDataSource1.Name = "JewelsDataSet"
       ReportDataSource1.Value = Me.StoreBindingSource
       ReportViewer3.LocalReport.DataSources.Add(ReportDataSource1)

       ReportViewer3.LocalReport.ReportEmbeddedResource = "ReportTest2.StoreRpt.rdlc"
       ReportViewer3.RefreshReport()

       bytes = ReportViewer3.LocalReport.Render("PDF", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)

       Dim fs As New FileStream("c:\outputvb.pdf", FileMode.Create)
       fs.Write(bytes, 0, bytes.Length)
       fs.Close()

   End Sub
Posted
Updated 9-Jul-14 9:02am
v2
Comments
[no name] 9-Jul-14 12:02pm    
Try saving your file to someplace other than the root directory of your C drive.
Maciej Los 9-Jul-14 15:08pm    
Not much information. Try to remove the datasource from the Report menu and then add it again. Check the name of datasource and emberedded resources.
If it won't help, let me know (by using Reply button).

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