Dim report As New LocalReport() report.ReportPath = "Reports\myReport.rdlc" report.Refresh() ' Export the report to an EMF file export(report, "test") ' Print the report print("test") <snip>
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)() Try <THE NEXT LINE THROWS THE ERROR> report.Render("Image", deviceInfo, AddressOf createStream, warnings) Catch ex As Exception Dim a As String = ex.Message End Try For Each stream As Stream In mStreams stream.Position = 0 Next Return "SUCCESS" End Function
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!