OK, so this might be difficult to explain but bear with me :)
I have an ASPX (VB) page on which I need to print a .rdlc report; note: I'm not
using a reportViewer as I'm streaming directly to the printer without previewing.
When I create the report with a single text box with static text, every thing woks fine.
As soon as I add a DataSet to the report I get an error when I try to render the report to the stream "An error occurred during local report processing."
. Even though I have not added any of the fields in the dataset to the report yet. The dataset itself is a very simply query which returns 1 row with 1 col (a single value)
The code to print the report is as follows:
In the Button Click event:
Dim report As New LocalReport()
report.ReportPath = "Reports\myReport.rdlc"
' Export the report to an EMF file
' Print the report
The export function:
Private Function export(ByVal report As LocalReport, ByVal pApp As String) As String
' gets printer device info, orientation & page size etc....
Dim deviceInfo As String = getPrinterDeviceInfo(pApp)
Dim warnings As Warning()
mStreams = New List(Of Stream)()
<THE NEXT LINE THROWS THE ERROR>
report.Render("Image", deviceInfo, AddressOf createStream, warnings)
Catch ex As Exception
Dim a As String = ex.Message
For Each stream As Stream In mStreams
stream.Position = 0
I'm using this exact same method to print other reports in the project but those report don't need any dataset as they are all static text and they print perfectly.