views:

398

answers:

3

Guys,

I am using the following code to output a Crystal Report to an ASP.NET application:

Dim rptDocument As New ReportDocument
Dim rptPath As String = Server.MapPath("Reports/Employees.rpt")

rptDocument.Load(rptPath)
Me.CrystalReportViewer1.ReportSource = rptDocument

Everything is working fine. My question is, is there a way to render the report as a PDF file instead of rendering to a crystalreportviewer?

I am using Visual Studio 2008 and Crystal Reports for Visual Studio 2008.

A: 

To very literally answer your Yes/No question, I believe the answer is yes. I reallize though you probably want to also know "How do I do it?". Some years ago I did this in VB.NET using the Crystal Reports runtime in a desktop application, but I do not remember nor have that code. Sorry.

AaronLS
+3  A: 

Yes, you can use ExportToHttpResponse. Set the ExportFormatType to PortableDocFormat. Check out this tutorial.

JP Alioto
A: 
DJ Matthews