in

ASP.NET Weblogs

Gregory Rubinstein

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:

  1. 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.

  2. programmatically convert the Crystal Report object into a PDF document using the Crystal Reports API

Below is the code for the second approach:

Dim report As CrystalReport1 = New CrystalReport1
SqlDataAdapter1.Fill(DataSet11)
report.SetDataSource(DataSet11)
report.ExportToHttpResponse (ExportFormatType.PortableDocFormat, Response, False, "ExportedReport")

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add