Crystal report Export Error

Discussion in 'ASP .Net' started by Leonard Danao, Aug 3, 2005.

  1. Anyone have any ideas as to why this is happenning. There are no other
    versions of Crystal installed aside from the one that came with vs2003
    enterprise.

    the error happens when the btnShowPDF_Click event is triggered
    private void btnShowPDF_Click(object sender, System.EventArgs e)

    {

    string
    strFName="c:/inetpub/wwwroot/rglHG/admin/administrator/surveyReport/prtPrvwS
    ctnTempQstn/prtPrvwSctnTempQstn.pdf";

    ExportToDisk(strFName);

    Response.Redirect("prtPrvwSctnTempQstn.pdf");

    }

    private void ExportToDisk (string fileName)

    {

    DiskFileDestinationOptions diskOpts = new

    DiskFileDestinationOptions();

    //set the export format

    // Report.ExportOptions.ExportFormatType = ExportFormatType.RichText;

    crstRptPPSctnTempQstn1.ExportOptions.ExportFormatType =
    ExportFormatType.PortableDocFormat;

    // Report.ExportOptions.ExportFormatType = ExportFormatType.WordForWindows ;

    crstRptPPSctnTempQstn1.ExportOptions.ExportDestinationType =
    ExportDestinationType.DiskFile;

    //set the disk file options

    diskOpts.DiskFileName = fileName;

    crstRptPPSctnTempQstn1.ExportOptions.DestinationOptions = diskOpts;

    crstRptPPSctnTempQstn1.Export ();

    }

    Error in File
    C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad532a41-baf3-4cb4-b7d0-fff07
    43b6782.rpt: Access to report file denied. Another program may be using it.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details:
    CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Error in
    File
    C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad532a41-baf3-4cb4-b7d0-fff07
    43b6782.rpt: Access to report file denied. Another program may be using it.

    Source Error:

    Line 96: crstRptPPSctnTempQstn1.ExportOptions.DestinationOptions =
    diskOpts;
    Line 97:
    Line 98: crstRptPPSctnTempQstn1.Export ();
    Line 99: }
    Line 100:

    Source File:
    c:\inetpub\wwwroot\rglHG\admin\administrator\surveyReport\prtPrvwSctnTempQst
    n\pgPPSctnTempQstn.aspx.cs Line: 98

    Stack Trace:

    [LoadSaveReportException: Error in File
    C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad532a41-baf3-4cb4-b7d0-fff07
    43b6782.rpt:
    Access to report file denied. Another program may be using it.]
    .F(String  , EngineExceptionErrorID 
    )
    .A(Int16 , Int32 )
    .@(Int16 )

    CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestCont
    ext reqContext)
    CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
    CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()

    rglHG.admin.administrator.surveyReport.prtPrvwSctnTempQstn.pgPPSctnTempQstn.
    ExportToDisk(String fileName) in
    c:\inetpub\wwwroot\rglHG\admin\administrator\surveyReport\prtPrvwSctnTempQst
    n\pgPPSctnTempQstn.aspx.cs:98

    rglHG.admin.administrator.surveyReport.prtPrvwSctnTempQstn.pgPPSctnTempQstn.
    btnShowPDF_Click(Object sender, EventArgs e) in
    c:\inetpub\wwwroot\rglHG\admin\administrator\surveyReport\prtPrvwSctnTempQst
    n\pgPPSctnTempQstn.aspx.cs:79
    System.Web.UI.WebControls.Button.OnClick(EventArgs e)

    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
    stBackEvent(String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    System.Web.UI.Page.ProcessRequestMain() +1277
    Leonard Danao, Aug 3, 2005
    #1
    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. Benny

    export crystal report file

    Benny, Nov 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    403
    Benny
    Nov 6, 2003
  2. =?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,817
    =?Utf-8?B?c3VpY2lkYWx0ZW5kZW5jaWVz?=
    Feb 5, 2004
  3. Colin Graham
    Replies:
    0
    Views:
    1,439
    Colin Graham
    Nov 17, 2004
  4. Comfort
    Replies:
    0
    Views:
    537
    Comfort
    Oct 18, 2004
  5. Colin Graham
    Replies:
    1
    Views:
    175
    Scott Mitchell [MVP]
    Nov 17, 2004
Loading...

Share This Page