locked
Load Report Failed error from second time onwards RRS feed

  • Question

  • User-1106725024 posted

    Hi ,

    I am currently using VS 2008 web application with Crystal Report 9.1 dlls as a reference.  I write below lines in Page_Load to load "report1.rpt" which is designed in Crystal Report 9.1.

              ReportDocument rpt = new ReportDocument();

              rpt.Load(Server.MapPath("report1.rpt"));

    When I run the application it works for the first time without any error, but when I re-run or refresh the page from second time onwards, It gives me an error "Load Report Failed".  As soon as I close Visual Studio / stopped ASP.Net Development Server / do IISReset if run in release mode, it again works fine for 1 time.

    We have found that when it runs for the first time, it creates a copy of rpt file in Temp folder.  When we delete that file it again works fine for 1 time.  Can we have any method to override this copy to other folder which we defined in config file.  If we do that we can delete that file when it runs for the first time.

    Can someone help me in resolving the above problem. 

    Kindly note that I cannot install crystal report 10.5 or I cannot redesign the rpt file in 8.5 which I think will work fine.  I have to use above environment.

    Thanks in advance, Meehir Jha

    Friday, July 1, 2011 5:07 AM

Answers

  • User-1694870838 posted

    Hi,

    Please check that if you  bind your data source after you refresh the page . 

    Best Regards,

    Damon

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 4, 2011 10:14 PM

All replies

  • User191633014 posted

    try:

    rpt.Load(Server.MapPath("report1.rpt"), OpenReportMethod.OpenReportByTempCopy)

    Friday, July 1, 2011 5:59 AM
  • User-1106725024 posted

    Hey Steelymar,

    Thanks for reply. I tried it but unfortunately it is still not working.  It behaves similar as earlier.

    Please help.

    Friday, July 1, 2011 7:41 AM
  • User191633014 posted

    did you close the ReportDocument  after using it?

    Friday, July 1, 2011 8:01 AM
  • User-1106725024 posted

    Yes we have close the ReportDocument and still it giving the same error.  Below is the code for the same:

    protected void Page_Load(object sender, EventArgs e)

    {

    var obj1 = new ReportDocument();

    var reportName = Server.MapPath("report1.rpt");

    obj1.Load(reportName, OpenReportMethod.OpenReportByTempCopy);

    obj1.Close();

    obj1.Dispose();

    GC.Collect(); 

    }

    Friday, July 1, 2011 8:53 AM
  • User-1694870838 posted

    Hi,

    Please check that if you  bind your data source after you refresh the page . 

    Best Regards,

    Damon

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 4, 2011 10:14 PM