By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,709 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,709 IT Pros & Developers. It's quick & easy.

Problem in exporting pdf file from crystal report

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi

Nothing is wrong in your code. The problem is you need
give your APSNET account 'Write' permission to folder
c:\Documents and Settings\TWIN2\ASPNET\Local Settings

HTH

Elton Wang
el********@hotmail.com
-----Original Message-----
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.DiskFileDestinationOption s = New
CrystalDecisions.Shared.DiskFileDestinationOption s
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
.

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.