Disposing The ReportDocument object RRS feed

  • Question

  • Dear Friends,

            Application : ASP.Net 1.1 and Crystal reports 9

            We are having one Common ReportViewer page named ReportViewer.aspx

            In Page_Load, we are getting the reportdocument from session and loading into reportviewer.
            This works fine for some time. After that we are facing, " Maximum no of jobs limited by administrator error " or "Load report failed" error.

            Finally, we came to know that GC is not releasing the ReportDocument object until we force it.
    So we tried to force GC at the Page_Unload event. But this fails at the time of navigating the pages across reportviewer, "Incorrect logon parameter erorr" is coming.
            We can't use Single ReportDocument object, since we need to open mutiple reports at a time.

            Is There any possibility to dispose the ReportDocument at the time of Browser window close?
            Is there anything to do with IDisposable interface without anyproblem while naviagting reportviewer.

    Advance Thanks for all your help.

            ASP.Net 1.1 , Crystal reports 9        
    Saturday, October 11, 2008 12:22 PM


  • You may be running into issues which have since been resolved with .Net 2/3. Something is keeping it referenced during the lifetime of the application/web service. I recomend that you look into the app pool in IIS and recycle the site in a more timely fashion. Otherwise the real answer is to move it to .Net 2/3.5 instead of relying on 6 year old code for critcal business activities. IMHO

    William Wegerson (www.OmegaCoder.Com)
    • Marked as answer by Zhi-Xin Ye Friday, October 17, 2008 7:56 AM
    Saturday, October 11, 2008 12:53 PM