L
Lasso
Hi all,
Im having problem in exporting pdf file from crystal
report. Now I already can show the crystal report but
error when exporting. this is my code:
Dim myReport As USERReport = New USERReport
Dim strExportFile As String = Server.MapPath
("../REPORT/") & "Output.pdf"
Dim DiskOpts As
CrystalDecisions.Shared.DiskFileDestinationOptions = New
CrystalDecisions.Shared.DiskFileDestinationOptions
myReport.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
myReport.ExportOptions.ExportFormatType =
CrystalDecisions.
[Shared].ExportFormatType.PortableDocFormat
DiskOpts.DiskFileName = strExportFile
myReport.ExportOptions.DestinationOptions =
DiskOpts
myReport.Export()
DiskOpts = Nothing
myReport = Nothing
Response.Write(strExportFile)
The error was:
Error in File C:\DOCUME~1\TWIN2\ASPNET\LOCALS~1
\Temp\temp_1ac38896-d6ac-4248-87ef-8ff3347956ff.rpt:
Access to report file denied. Another program may be
using it.
Is there anything wrong with my code?
Thanks
Im having problem in exporting pdf file from crystal
report. Now I already can show the crystal report but
error when exporting. this is my code:
Dim myReport As USERReport = New USERReport
Dim strExportFile As String = Server.MapPath
("../REPORT/") & "Output.pdf"
Dim DiskOpts As
CrystalDecisions.Shared.DiskFileDestinationOptions = New
CrystalDecisions.Shared.DiskFileDestinationOptions
myReport.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
myReport.ExportOptions.ExportFormatType =
CrystalDecisions.
[Shared].ExportFormatType.PortableDocFormat
DiskOpts.DiskFileName = strExportFile
myReport.ExportOptions.DestinationOptions =
DiskOpts
myReport.Export()
DiskOpts = Nothing
myReport = Nothing
Response.Write(strExportFile)
The error was:
Error in File C:\DOCUME~1\TWIN2\ASPNET\LOCALS~1
\Temp\temp_1ac38896-d6ac-4248-87ef-8ff3347956ff.rpt:
Access to report file denied. Another program may be
using it.
Is there anything wrong with my code?
Thanks