Converting ASP.NET to PDF
I probably wouldn't be wrong if I said that most developers every now and then are tasked to present specific data contained in a webpage as a PDF document. There are two ways to do it:
- using the functionality of CrystalReportViewer's toolbar - this toolbar provides a button, which does exactly that. However, to use this approach you would have to actually display the crystal report on the page.
- programmatically convert the Crystal Report object into a PDF document using the Crystal Reports API
Dim report As CrystalReport1 = New CrystalReport1
SqlDataAdapter1.Fill(DataSet11)
report.SetDataSource(DataSet11)
report.ExportToHttpResponse (ExportFormatType.PortableDocFormat, Response, False, "ExportedReport")