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.
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.