Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step tutorials and online videos.

Click Here To Learn More »

19.11 Printing via the Browser

Printing with ASP.NET

The Crystal Reports web viewer control gives you a print button to send your reports directly to the printer. But, there are times when you want to view them in a different format, or save them to a separate file. For example, many people like to view reports as a PDF file because they feel that it gives the report a more professional look.

The ReportDocument.ExportToHttpResponse() method exports files directly to the Http Response object. This lets the user view the file directly in the browser window or save it to their local computer.

The code for using the ExportToHttpResponse() method is very similar to calling the Export() method. The primary difference is that you don’t need to specify the destination option because it is always being exported to Http. Second, there are a couple new arguments to pass to it. The method is overloaded with two declarations:

ExportToHttpResponse(ExportFormatType, HttpResponse, Attachment (Boolean), Filename)
ExportToHttpResponse(ExportOptions, HttpResponse, Attachment (Boolean), Filename)

The first declaration is the more simplistic of the two. The first parameter is the format type (PDF, Excel, etc.). The second parameter is the...

Get UNLIMITED Crystal Reports Online Training!

Click Here To Start Your Training!

1500+ Tutorial Pages

Complete Crystal Reports Online Training with over 1,500 pages of better than book quality Crystal Reports tutorials.

Step-by-step Online Videos

Learn at your own pace from the comfort of your home! Pause, rewind and watch online training videos anytime!

Online Community

Members-only community where you can post and answer questions. The community is checked on a regular basis by best selling Crystal Reports book author Brian Bischof to help answer your questions.

Cut & Paste Source Code

Save time with simple cut and paste source code you can use right now in your next report!

Click Here To Start Your Training!