THE PUTXI PROJECT

Catalonia is Not Spain

Create PDF from CrystalReport

Posted by putxi on April 18, 2007

The following code explains how to create a PDF File when you have a CrystalReport

You must use this namespace : using CrystalDecisions.Shared;

CrystalReport2 crReport = new CrystalReport2();
ExportOptions crExpOpt = crReport.ExportOptions;
DiskFileDestinationOptions crExpDest = new DiskFileDestinationOptions();
crExpDest.DiskFileName = “c:\\myexportedreport.pdf”;

crExpOpt.ExportDestinationType = ExportDestinationType.DiskFile;
crExpOpt.ExportFormatType = ExportFormatType.PortableDocFormat ;

crExpOpt.DestinationOptions = crExpDest;
crReport.Export();

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>