473,473 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem in exporting pdf file from crystal report

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
1 3873
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: DeeCay | last post by:
Dear folks, I was trying to write a .Net web application (using C#) that loads a Crystal Report on server side, export the report in PDF format as a file in the web server, and then serves up...
0
by: George G. | last post by:
I am exporting a report to an Excel file. Whatever options I use for the formatting the results remain the same. I have set the ExcelTabHasColumnHeadings to true and false without any difference. I...
0
by: naveen | last post by:
I am facing problem to export crystal report to PDF which contains some item's images. All images change with first item image. the application developed in Visual Basic 6.0 and MS access. The...
1
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream...
2
by: Pinku | last post by:
Hello guy, I have a problem with Crystal Report. In my report I would use a box with rounded corner, so i put it into the designer and all works fine, but, when i try to export the report to...
4
by: BizWorld | last post by:
I am getting this error in exporting a crystal report (having two subreports) using C# code. i got the following exception at Export statement. Exception Details:...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
1
by: pintoo | last post by:
Hi, I have 2 sites (Site A, B) running on same windows 2003 server pointing to different home directories. User logs into site A and is shown a.aspx page and user credentials are saved in...
0
by: smtwtfs007 | last post by:
Any body has any idea about his error please? I got this error at the time of creating crystal report. I tried everything to resolve this error. But I could not. Please help. Exception has...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.