Problem in exporting pdf file from crystal report

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
 
E

Elton Wang

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
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top