tonylmiller
Programmer
I am getting the following error when I try to export to a PDF file. As far as I know, no other application is using this report file. I am using Crystal Reports.NET. I am getting the error when I am in Visual Studio.NET and I try to build and browse the form.
Error in File c:\inetpub\ Access to report file denied. Another program may be using it.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Error in File c:\inetpub\ Access to report file denied. Another program may be using it.
My export code looks like this:
Any help would be greatly appreciated.
Tony
Error in File c:\inetpub\ Access to report file denied. Another program may be using it.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Error in File c:\inetpub\ Access to report file denied. Another program may be using it.
Code:
Source Error:
Line 42:
Line 43: // Export the report.
Line 44: Report.Export();
Line 45: }
Line 46:
My export code looks like this:
Code:
ReportDocument Report = new ReportDocument();
Report.Load("c:\\inetpub\\[URL unfurl="true"]wwwroot\\webapplication1\\rptitems.rpt");[/URL]
// Declare variables and get the export options.
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
diskOpts.DiskFileName = "c:\\report.pdf";
ExportOptions exportOpts = new ExportOptions();
exportOpts = Report.ExportOptions;
// Set the export format.
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
// Set the disk file options.
exportOpts.DestinationOptions = diskOpts;
// Export the report.
Report.Export();
Any help would be greatly appreciated.
Tony