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

Export from crystal report to pdf

P: n/a
I am trying to export crystal report to pdf. but i am getting folloing error: "Error in File C:\DOCUME~1\MKM-BA~1\ASPNET\LOCALS~1\Temp\temp_0c6b2c59-df8a-4b26-a570-a2189ee212ac.rpt: Access to report file denied. Another program may be using it."

It works with other reports but not this one.

Code using for export:
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String

myExportFile = "c:\inetpub\wwwroot\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = crystalReport31.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
crystalReport31.Export()

Thanks in advance
Mandar
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 7/28/2004 11:18 AM, Mandar wrote:
I am trying to export crystal report to pdf. but i am getting folloing error: "Error in File C:\DOCUME~1\MKM-BA~1\ASPNET\LOCALS~1\Temp\temp_0c6b2c59-df8a-4b26-a570-a2189ee212ac.rpt: Access to report file denied. Another program may be using it."

It works with other reports but not this one.

Code using for export:
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String

myExportFile = "c:\inetpub\wwwroot\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = crystalReport31.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
crystalReport31.Export()

Thanks in advance
Mandar


When you load the report (crystalReport31.Load(..)), there's an overload
for that method, that has a parameter to indicate how to open the report:

http://msdn.microsoft.com/library/de...ationtopic.asp

if you use the temp copy option, it should not lock the report when you
open it, which is what I think is happening.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #2

P: n/a
On 7/28/2004 12:24 PM, Mandar wrote:
Thanks Craig for reply
by default it opens as temporary copy.
it does not give any error if i try word document instead of pdf.
i m not using load() anywhere
Regards

"Craig Deelsnyder" wrote:

On 7/28/2004 11:18 AM, Mandar wrote:

I am trying to export crystal report to pdf. but i am getting folloing error: "Error in File C:\DOCUME~1\MKM-BA~1\ASPNET\LOCALS~1\Temp\temp_0c6b2c59-df8a-4b26-a570-a2189ee212ac.rpt: Access to report file denied. Another program may be using it."

It works with other reports but not this one.

Code using for export:
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String

myExportFile = "c:\inetpub\wwwroot\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = crystalReport31.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
crystalReport31.Export()

Thanks in advance
Mandar


When you load the report (crystalReport31.Load(..)), there's an overload
for that method, that has a parameter to indicate how to open the report:

http://msdn.microsoft.com/library/de...ationtopic.asp

if you use the temp copy option, it should not lock the report when you
open it, which is what I think is happening.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET


sorry, that's all I had; it's been awhile since I've done CR, and I
thought this fixed my problem like this back then. I didn't notice by
default that was set. You might try the CR forums at http://asp.net or
the CR developer zone at:

http://www.businessobjects.com/products/dev_zone/

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #3

P: n/a
Hi Mandar,

In addition to Craig's suggestion. You can also ask the Crystal Report
service support through the guides in the following kb article:

#How To Get Help with Crystal Reports - International and U.S.
http://support.microsoft.com/?id=100368

Thanks.
Thanks.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #4

P: n/a
3 steps cleared this up for me.

1) You need to set in InetMgr the folder you are exporting to to be Write
enabled.
2) Also in InetMgr, under the porperties for your export folder, you need to
set the Application Pool setting to: MSSharePointAppPool.
3) And finally, you need to set, under Windows Explorer, the security level
for the export folder to Everyone=Full Control.

This should clear you up....did for me when I had this *exact* same problem.

But don't take just my word for it:
http://dotnetjunkies.com/WebLog/rich.../24/14362.aspx

-- Andrew
"Mandar" <sh***@nospam.nospam> wrote in message
news:CA**********************************@microsof t.com...
I am trying to export crystal report to pdf. but i am getting folloing error: "Error in File
C:\DOCUME~1\MKM-BA~1\ASPNET\LOCALS~1\Temp\temp_0c6b2c59-df8a-4b26-a570-a2189
ee212ac.rpt: Access to report file denied. Another program may be using it."
It works with other reports but not this one.

Code using for export:
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions Dim myExportFile As String

myExportFile = "c:\inetpub\wwwroot\" & Session.SessionID.ToString & ".pdf" myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = crystalReport31.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
crystalReport31.Export()

Thanks in advance
Mandar

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.