Export from crystal report to pdf

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFuZGFy?=, Jul 28, 2004.

  1. 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
     
    =?Utf-8?B?TWFuZGFy?=, Jul 28, 2004
    #1
    1. Advertising

  2. 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/d...tml/crlrfopenreportmethodenumerationtopic.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
     
    Craig Deelsnyder, Jul 28, 2004
    #2
    1. Advertising

  3. 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/d...tml/crlrfopenreportmethodenumerationtopic.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
     
    Craig Deelsnyder, Jul 28, 2004
    #3
  4. 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.)
     
    Steven Cheng[MSFT], Jul 29, 2004
    #4
  5. =?Utf-8?B?TWFuZGFy?=

    Andrew Guest

    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/richard.dudley/archive/2004/05/24/14362.aspx

    -- Andrew


    "Mandar" <> wrote in message
    news:...
    > 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
     
    Andrew, Aug 12, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c3VpY2lkYWx0ZW5kZW5jaWVz?=

    Export PDF from Crystal Report .NET using ASP.NET

    =?Utf-8?B?c3VpY2lkYWx0ZW5kZW5jaWVz?=, Feb 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,920
    =?Utf-8?B?c3VpY2lkYWx0ZW5kZW5jaWVz?=
    Feb 5, 2004
  2. Colin Graham
    Replies:
    0
    Views:
    1,467
    Colin Graham
    Nov 17, 2004
  3. Dave
    Replies:
    0
    Views:
    660
  4. Replies:
    0
    Views:
    637
  5. Comfort
    Replies:
    0
    Views:
    597
    Comfort
    Oct 18, 2004
Loading...

Share This Page