Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export crystal report to PDF

Status
Not open for further replies.

meydz

Programmer
Joined
Jun 29, 2003
Messages
31
Location
PH
I am creating a report in crystal and export it to pdf at runtime. Below is the sample code

DiskFileDestinationOptions diskDestination = new DiskFileDestinationOptions();

reportDocument.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;

reportDocument.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

string fileName = "C:\\reportsample.pdf";
diskDestination.DiskFileName = fileName;

reportDocument.ExportOptions.DestinationOptions = diskDestination;

reportDocument.Export(); //this line triggers the error
reportDocument.Close();

the exception is :
Error in File C:\WINNT\TEMP\temp_1066b89b-658b-495b-ab56-27a343805d6d.rpt: Access to report file denied. Another program may be using it.

Is there anyone who knows how to get over it?
Thanks! Any help would be highly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top