Click here to Skip to main content
Click here to Skip to main content
Alternative Tip
Go to top

Generate a PDF document from exported stream of a crystal report

, 10 May 2010
Rate this:
Please Sign up or sign in to vote.
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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

atverweij
Chief Technology Officer buildIT IT-Solutions BV
Netherlands Netherlands
Theo worked as a VB architect and software engineer since 1994, started with VB3, en is working with VB ever since to build mission critical enterprise applications for a wide range of customers.

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 10 May 2010
Article Copyright 2010 by atverweij
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid