I'm developing reports with using Crystal Report Viewer
on ASP.NET. After I have report done I try to export it
to .PDF format and get the following error:
"Error in File C:\DOCUME~1\4974-W\ASPNET\LOCALS~1
\Temp\temp_2bc3fd27-1cdb-47af-9cf5-1795a1d8aff0.rpt:
Access to report file denied. Another program may be
using it."
The code I use:
Dim crDiskFileDestinationOptions as New
DiskFileDestinationOptions
crDiskFileDestinationOptions.DiskFileName
= "C:\Report.pdf"
Dim crReportDocument As New
Work_Item_Status_by_OM_Representative
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType =
ExportDestinationType.DiskFile
.ExportFormatType =
ExportFormatType.PortableDocFormat
End With
crReportDocument.Export()
Thank you for any help!