Re: Error with Crystal Reports? Help

Discussion in 'ASP .Net' started by Russ, Jan 9, 2004.

  1. Russ

    Russ Guest

    Perhaps someone can see a flaw in my code for exporting the files to pdf:

    private void convertToPDF()
    {

    CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new
    CrystalDecisions.Shared.DiskFileDestinationOptions();
    sqlSelectCommand1.Parameters["@date1"].Value =
    DateTime.Parse(TextBox1.Text);
    sqlSelectCommand1.Parameters["@date2"].Value =
    DateTime.Parse(TextBox2.Text);
    BondExpiration oRpt = new BondExpiration();
    oRpt.SetDataSource(dsBondExpiration1);
    oRpt.ExportOptions.ExportDestinationType =
    CrystalDecisions.Shared.ExportDestinationType.DiskFile;
    oRpt.ExportOptions.ExportFormatType =
    CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
    string FilePath = Server.MapPath(@".\Report\") + "BondExpiration.pdf";
    DiskOpts.DiskFileName = FilePath;
    oRpt.ExportOptions.DestinationOptions = DiskOpts;
    oRpt.Export();
    CrystalReportViewer1.ReportSource = oRpt;
    CrystalReportViewer1.Visible = true;
    CrystalReportViewer1.DataBind();
    }

    Like I said, it used to work on my production server and still works on my
    development machine. The only major difference between the 2 machines is
    the production server is running Window 2000 Server and production is
    Windows XP Pro.


    "Russ" <> wrote in message
    news:...
    > I have a page that uses crystal reports to generate reports from a SQl
    > server database. As of a week ago everything was working fine, but now I

    am
    > all of the sudden getting errors. To the best of my knowledge nothing was
    > changed on the server.
    >
    > Here is the error:
    >
    > Error in File C:\DOCUME~1\WEBSERVER\ASPNET\Local
    > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt: Invalid

    export
    > DLL or export format.
    > 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.InvalidArgumentException: Error in
    > File C:\DOCUME~1\PLUTO\ASPNET\Local
    > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt: Invalid

    export
    > DLL or export format.
    >
    > Source Error:
    >
    > An unhandled exception was generated during the execution of the current

    web
    > request. Information regarding the origin and location of the exception

    can
    > be identified using the exception stack trace below.
    >
    > Stack Trace:
    >
    >
    > [InvalidArgumentException: Error in File C:\DOCUME~1\PLUTO\ASPNET\Local
    > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt:
    > Invalid export DLL or export format.]
    > .F(String  , EngineExceptionErrorID 
    > ) +406
    > .A(Int16 , Int32 ) +537
    >
    >

    CrystalDecisions.CrystalReports.Engine.FormatEngine.internalSetExportOptions
    > (ExportOptions exportOptions) +3403
    >
    >

    CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestCont
    > ext reqContext) +262
    > CrystalDecisions.CrystalReports.Engine.FormatEngine.Export() +107
    > CrystalDecisions.CrystalReports.Engine.ReportDocument.Export() +67
    > Bonds_Reports.WebForm1.convertToPDF() +215
    > Bonds_Reports.WebForm1.ddlSort_SelectedIndexChanged(Object sender,
    > EventArgs e) +135
    > System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs

    e)
    > +108
    >
    >

    System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.Ra
    > isePostDataChangedEvent() +26
    > System.Web.UI.Page.RaiseChangedEvents() +115
    > System.Web.UI.Page.ProcessRequestMain() +1081
    >
    >
    >
    >
    > --------------------------------------------------------------------------

    --
    > ----
    > Version Information: Microsoft .NET Framework Version:1.1.4322.573;

    ASP.NET
    > Version:1.1.4
    >
    > Does anyone understand what might be happening?
    >
    >
    Russ, Jan 9, 2004
    #1
    1. Advertising

  2. Russ

    A.Hadi Guest

    Hi
    http://support.crystaldecisions.com/library/kbase/articles/c2007034.asp



    "Russ" <> wrote in message news:<e#>...
    > Perhaps someone can see a flaw in my code for exporting the files to pdf:
    >
    > private void convertToPDF()
    > {
    >
    > CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new
    > CrystalDecisions.Shared.DiskFileDestinationOptions();
    > sqlSelectCommand1.Parameters["@date1"].Value =
    > DateTime.Parse(TextBox1.Text);
    > sqlSelectCommand1.Parameters["@date2"].Value =
    > DateTime.Parse(TextBox2.Text);
    > BondExpiration oRpt = new BondExpiration();
    > oRpt.SetDataSource(dsBondExpiration1);
    > oRpt.ExportOptions.ExportDestinationType =
    > CrystalDecisions.Shared.ExportDestinationType.DiskFile;
    > oRpt.ExportOptions.ExportFormatType =
    > CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
    > string FilePath = Server.MapPath(@".\Report\") + "BondExpiration.pdf";
    > DiskOpts.DiskFileName = FilePath;
    > oRpt.ExportOptions.DestinationOptions = DiskOpts;
    > oRpt.Export();
    > CrystalReportViewer1.ReportSource = oRpt;
    > CrystalReportViewer1.Visible = true;
    > CrystalReportViewer1.DataBind();
    > }
    >
    > Like I said, it used to work on my production server and still works on my
    > development machine. The only major difference between the 2 machines is
    > the production server is running Window 2000 Server and production is
    > Windows XP Pro.
    >
    >
    > "Russ" <> wrote in message
    > news:...
    > > I have a page that uses crystal reports to generate reports from a SQl
    > > server database. As of a week ago everything was working fine, but now I

    > am
    > > all of the sudden getting errors. To the best of my knowledge nothing was
    > > changed on the server.
    > >
    > > Here is the error:
    > >
    > > Error in File C:\DOCUME~1\WEBSERVER\ASPNET\Local
    > > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt: Invalid

    > export
    > > DLL or export format.
    > > 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.InvalidArgumentException: Error in
    > > File C:\DOCUME~1\PLUTO\ASPNET\Local
    > > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt: Invalid

    > export
    > > DLL or export format.
    > >
    > > Source Error:
    > >
    > > An unhandled exception was generated during the execution of the current

    > web
    > > request. Information regarding the origin and location of the exception

    > can
    > > be identified using the exception stack trace below.
    > >
    > > Stack Trace:
    > >
    > >
    > > [InvalidArgumentException: Error in File C:\DOCUME~1\PLUTO\ASPNET\Local
    > > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt:
    > > Invalid export DLL or export format.]
    > > . F(String , EngineExceptionErrorID
    > > ) +406
    > > . A(Int16 , Int32 ) +537
    > >
    > >

    > CrystalDecisions.CrystalReports.Engine.FormatEngine.internalSetExportOptions
    > > (ExportOptions exportOptions) +3403
    > >
    > >

    > CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestCont
    > > ext reqContext) +262
    > > CrystalDecisions.CrystalReports.Engine.FormatEngine.Export() +107
    > > CrystalDecisions.CrystalReports.Engine.ReportDocument.Export() +67
    > > Bonds_Reports.WebForm1.convertToPDF() +215
    > > Bonds_Reports.WebForm1.ddlSort_SelectedIndexChanged(Object sender,
    > > EventArgs e) +135
    > > System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs

    > e)
    > > +108
    > >
    > >

    > System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.Ra
    > > isePostDataChangedEvent() +26
    > > System.Web.UI.Page.RaiseChangedEvents() +115
    > > System.Web.UI.Page.ProcessRequestMain() +1081
    > >
    > >
    > >
    > >
    > > --------------------------------------------------------------------------

    > --
    > > ----
    > > Version Information: Microsoft .NET Framework Version:1.1.4322.573;

    > ASP.NET
    > > Version:1.1.4
    > >
    > > Does anyone understand what might be happening?
    > >
    > >
    A.Hadi, Jan 28, 2004
    #2
    1. Advertising

  3. Russ

    Madan Nayak Guest

    Hi...

    Pl. make sure the cystal report for .Net is installed on your production
    server.

    Which model have you used in your crystal report? Push or pull???

    Do you have the same database name in bothe developement and production
    server...

    Are you deleteing the temp files generated after each export?...

    pl. try that....


    "A.Hadi" <> wrote in message
    news:...
    > Hi
    > http://support.crystaldecisions.com/library/kbase/articles/c2007034.asp
    >
    >
    >
    > "Russ" <> wrote in message

    news:<e#>...
    > > Perhaps someone can see a flaw in my code for exporting the files to

    pdf:
    > >
    > > private void convertToPDF()
    > > {
    > >
    > > CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new
    > > CrystalDecisions.Shared.DiskFileDestinationOptions();
    > > sqlSelectCommand1.Parameters["@date1"].Value =
    > > DateTime.Parse(TextBox1.Text);
    > > sqlSelectCommand1.Parameters["@date2"].Value =
    > > DateTime.Parse(TextBox2.Text);
    > > BondExpiration oRpt = new BondExpiration();
    > > oRpt.SetDataSource(dsBondExpiration1);
    > > oRpt.ExportOptions.ExportDestinationType =
    > > CrystalDecisions.Shared.ExportDestinationType.DiskFile;
    > > oRpt.ExportOptions.ExportFormatType =
    > > CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
    > > string FilePath = Server.MapPath(@".\Report\") +

    "BondExpiration.pdf";
    > > DiskOpts.DiskFileName = FilePath;
    > > oRpt.ExportOptions.DestinationOptions = DiskOpts;
    > > oRpt.Export();
    > > CrystalReportViewer1.ReportSource = oRpt;
    > > CrystalReportViewer1.Visible = true;
    > > CrystalReportViewer1.DataBind();
    > > }
    > >
    > > Like I said, it used to work on my production server and still works on

    my
    > > development machine. The only major difference between the 2 machines

    is
    > > the production server is running Window 2000 Server and production is
    > > Windows XP Pro.
    > >
    > >
    > > "Russ" <> wrote in message
    > > news:...
    > > > I have a page that uses crystal reports to generate reports from a SQl
    > > > server database. As of a week ago everything was working fine, but

    now I
    > > am
    > > > all of the sudden getting errors. To the best of my knowledge nothing

    was
    > > > changed on the server.
    > > >
    > > > Here is the error:
    > > >
    > > > Error in File C:\DOCUME~1\WEBSERVER\ASPNET\Local
    > > > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt: Invalid

    > > export
    > > > DLL or export format.
    > > > 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.InvalidArgumentException: Error

    in
    > > > File C:\DOCUME~1\PLUTO\ASPNET\Local
    > > > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt: Invalid

    > > export
    > > > DLL or export format.
    > > >
    > > > Source Error:
    > > >
    > > > An unhandled exception was generated during the execution of the

    current
    > > web
    > > > request. Information regarding the origin and location of the

    exception
    > > can
    > > > be identified using the exception stack trace below.
    > > >
    > > > Stack Trace:
    > > >
    > > >
    > > > [InvalidArgumentException: Error in File

    C:\DOCUME~1\PLUTO\ASPNET\Local
    > > > Settings\Temp\temp_57908cf8-dba0-4327-b785-95de5cf6e523.rpt:
    > > > Invalid export DLL or export format.]
    > > > . F(String , EngineExceptionErrorID
    > > > ) +406
    > > > . A(Int16 , Int32 ) +537
    > > >
    > > >

    > >

    CrystalDecisions.CrystalReports.Engine.FormatEngine.internalSetExportOptions
    > > > (ExportOptions exportOptions) +3403
    > > >
    > > >

    > >

    CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestCont
    > > > ext reqContext) +262
    > > > CrystalDecisions.CrystalReports.Engine.FormatEngine.Export() +107
    > > > CrystalDecisions.CrystalReports.Engine.ReportDocument.Export() +67
    > > > Bonds_Reports.WebForm1.convertToPDF() +215
    > > > Bonds_Reports.WebForm1.ddlSort_SelectedIndexChanged(Object sender,
    > > > EventArgs e) +135
    > > >

    System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs
    > > e)
    > > > +108
    > > >
    > > >

    > >

    System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.Ra
    > > > isePostDataChangedEvent() +26
    > > > System.Web.UI.Page.RaiseChangedEvents() +115
    > > > System.Web.UI.Page.ProcessRequestMain() +1081
    > > >
    > > >
    > > >
    > > >

    > >

    > --------------------------------------------------------------------------
    > > --
    > > > ----
    > > > Version Information: Microsoft .NET Framework Version:1.1.4322.573;

    > > ASP.NET
    > > > Version:1.1.4
    > > >
    > > > Does anyone understand what might be happening?
    > > >
    > > >
    Madan Nayak, Jan 28, 2004
    #3
    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.

Share This Page