65.9K
CodeProject is changing. Read more.
Home

Generate a PDF document from exported stream of a crystal report

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

May 10, 2010

CPOL
viewsIcon

8892

The last part can be written much easier in VB:Private Sub msGPDF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msGPDF.Click Dim Stream As IO.Stream = objRpt.ExportToStream(ExportFormatType.PortableDocFormat) Dim Buffer(CInt(Stream.Length)) As Byte ...

The last part can be written much easier in VB:
Private Sub msGPDF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles msGPDF.Click
    Dim Stream As IO.Stream = objRpt.ExportToStream(ExportFormatType.PortableDocFormat)
    Dim Buffer(CInt(Stream.Length)) As Byte
    Stream.Read(Buffer, 0, CInt(Stream.Length))
    My.Computer.FileSystem.WriteAllBytes("Report.pdf", Buffer, False)
    System.Diagnostics.Process.Start(fs.Name)
End Sub