Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Export from crystal report to pdf

Reply
Thread Tools

Export from crystal report to pdf

 
 
=?Utf-8?B?TWFuZGFy?=
Guest
Posts: n/a
 
      07-28-2004
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
 
Reply With Quote
 
 
 
 
Craig Deelsnyder
Guest
Posts: n/a
 
      07-28-2004
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
 
Reply With Quote
 
 
 
 
Craig Deelsnyder
Guest
Posts: n/a
 
      07-28-2004
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
 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      07-29-2004
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.)

 
Reply With Quote
 
Andrew
Guest
Posts: n/a
 
      08-12-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report Export to PDF Inline Fails emarvets@gmail.com ASP .Net 0 03-29-2006 06:00 PM
Export Crystal Report to PDF and open it in Acrobat Reader instead of Internet Explorer Dave ASP .Net 0 12-15-2004 04:54 PM
Error when attempting to export Crystal Report as PDF document asp.net Colin Graham ASP .Net 0 11-17-2004 05:32 PM
FAIL TO LOAD THE CRYSTAL REPORT USING WEB CRYSTAL REPORT VIEWER Comfort ASP .Net Web Controls 0 10-18-2004 01:35 PM
Export PDF from Crystal Report .NET using ASP.NET =?Utf-8?B?c3VpY2lkYWx0ZW5kZW5jaWVz?= ASP .Net 0 02-05-2004 05:26 PM



Advertisments