Private Function QuotePDF(ByVal intQuoteID As Integer) As MemoryStream
Dim warnings As Warning() = Nothing
Dim bytes As Byte()
Try
Dim rview As New ReportViewer
rview.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
rview.ServerReport.ReportServerUrl = New Uri("http://localhost/ReportServer")
rview.ServerReport.ReportPath = "/Report Bills/QuoteBill"
Dim paramList As New Generic.List(Of ReportParameter)
paramList.Add(New ReportParameter("QuoteID", intQuoteID.ToString))
rview.ServerReport.SetParameters(paramList)
bytes = rview.ServerReport.Render("PDF", Nothing, Nothing, Nothing, Nothing, Nothing, warnings)
Dim output As New System.IO.MemoryStream(bytes)
Return output
Catch ex As Exception
Throw
End Try
End Function
|