How do I export from Crystal Reports to PDF

Can anybody give me some knowledge (links) as to how I would export my ASP.NET Crystal Report to PDF.

 The way I see it, is I set up a button, that when clicked, exports the report to PDF.

Any help would be appreciated.

11/9/2006 4:30:23 PM 7043 articles. 0 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 47

One more question. How do I change the connection string?
11/9/2006 6:25:11 PM
Why not use the export button in the crystalviewer control. 
11/10/2006 2:57:10 PM

I'm using VS 2003 ASP .NET, NOT VB .NET. In VB .NET the Crystal Report viewer gives you an option to export to PDF. In ASP .NET the View does not give you that option.

If I am wrong on this, do please let me know.
In the mean time I found an article that helped me greatly.

That article was very helpful. Now I can export to Excel or PDF Big Smile .

 Still wondering how to change the connection string, otherwise when I move this application to the server it will not function.

11/10/2006 6:53:40 PM

hello my friend

i had the same problem with the PDF conversion i solved it with this code i found:

Dim myReport As New ReportDocument

        Dim myExportOptions As New CrystalDecisions.Shared.ExportOptions()
        Dim myDiskFileDestinationOptions As New CrystalDecisions.Shared.DiskFileDestinationOptions()
        Dim myFormatTypeOptions As New CrystalDecisions.Shared.PdfRtfWordFormatOptions()
        Dim s As String = TextBox1.Text
        myDiskFileDestinationOptions.DiskFileName = "C:\Inetpub\wwwroot\TDWS\" + s + ".pdf"

        myExportOptions = myReport.ExportOptions

        With myExportOptions
            .ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
            .ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
            .DestinationOptions = myDiskFileDestinationOptions
            .FormatOptions = myFormatTypeOptions
        End With
        MsgBox("Your report has been exported in PDF format and saved to C:\CrystalReports\Chapter08\test.pdf", MsgBoxStyle.Information, "Shut Up")


but the problem is u cant contol where its gonna b saved from the page , u have to type the path manually in the code which is so annoying

so using the crystal Report tool bar will b better , i'll check the link u mentioned also


about the connection string:

i dont know if u r using MS Access or SQL Server ,, but i've tested the below code and its working perfectly:

in ur web config add this:

<add key="MyConn" value= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\data\northwind.mdb;" />

 in ur code u can call ur connection by using this line:

 Dim myConnection As OledbConnection = New OledbConnection(ConfigurationSettings.AppSettings("MyConn"))

for SQL connection , add the connection by wizard "Add DB Connection" -which will add it automaticlly to ur web.config- then add these lines to ur code:

Dim s As String= System.Configuration.ConfigurationManager.ConnectionStrings"TESTDBConnectionString1").ConnectionString

         Dim DBConn As Data.SqlClient.SqlConnection

        DBConn = New SqlConnection


there might be a better way to do this ofcourse, but this is how i did it , and its working.


of course u have to Imports System.Data.SqlClient or Oledb


if u can do me one favour and direct me to a tutorial for crystal reports 11 ... need to know how to Group Data n Build Drill Down Reports and Use Formulas 




11/12/2006 5:58:48 AM

Web resources about - How do I export from Crystal Reports to PDF -

Crystal - Wikipedia, the free encyclopedia
This article is about crystalline solids. For the type of glass, see Lead glass . For other uses, see Crystal (disambiguation) . A crystal or ...

Wellington, the town in NSW where crystal meth costs less than beer
One NSW town is so overrun by the drug ice that it is known as &quot;little Antarctica&quot;, and police say children as young as 10 are experimenting. ...

Steve McClaren irate after Newcastle United's humiliating loss to Crystal Palace
Steve McClaren will haul his embattled Newcastle squad in for an extra training session on Sunday following their humiliating defeat at Crystal ...

Whoomp! There It Is Crystal Pepsi Is Coming Back
PepsiCo has made it official: Crystal Pepsi is coming back, but only for a limited time via a sweepstakes. The marketer hinted at a comeback ...

Former CIA Chief Morell: ‘Crystal Clear’ Obama’s ISIS Strategy Is Not Working
Former CIA Chief Morell: 'Crystal Clear' Obama's ISIS Strategy is Not Working

Crystal Lake man, 18, killed kitten over fight about bong: prosecutor
The 18-year-old man accused of killing a kitten with his bare hands had become enraged during an argument with his sister over a bong, a prosecutor ...

CEO: My 'crystal ball' is smoky
Here's what is keeping Corporate America on the sidelines, according to Waste Management CEO David Steiner.

Coke-Funded Anti-Obesity Group Goes The Way Of Crystal Pepsi
The Global Energy Balance Network, a supposed anti-obesity organization that was heavily criticized for not only receiving more than $1 million ...

Casey Wilson & June Diane Raphael Set Elizabeth Laime Comedy ‘Crystal’ At ABC
... duo, USB alums June Diane Raphael and Casey Wilson , have teamed with comedy writer/podcaster and fellow USB-er Elizabeth Laime for Crystal ...

Moon ring caused by iced crystals - FOX Carolina 21
... their heads to the sky for a better look. The moon has a ring around it! Meteorologist Kendra Kent says the ring is caused by ice crystals ...

Resources last updated: 12/9/2015 8:34:51 PM