Best practice to dispose PageReport

Posted by: grapecity on 8 December 2017, 2:10 am EST

    • Post Options:
    • Link

    Posted 8 December 2017, 2:10 am EST

    Hello,

    I am using AR 11 Version 11.1.9726.0 and I have PageReport which has Tablix control. The Excel out put of the report has 26 columns and 15,249 rows.

    What is the best way to dispose the page report?

    Currently i am using below code and which is not disposing the memory after the export is complete comparing to Section Report dispose.

    // Disposing PageReport

    pageReport.Document.Dispose();

    pageReport.Dispose();

    pageReport = null;

    reportData.Dispose();

    reportData = null;

    // Disposing Section Report

    report.Document.Dispose();

    report.Dispose();

    report = null;

    reportData.Dispose();

    reportData = null;

    Below link has sample code for disposing SectionReport, can you provide me sample code for disposing PageReport.

    http://help.grapecity.com/activereports/webhelp/AR11/index.html#arRELTroubleshooting.html

    Here are our test resuls comparing SectionReport VS PageReport disposing.

    Section Report export:

    Result: a spreadsheet with 14 columns and 279,302 rows

    I began the test by restarting the Export Service.

    Export 1: export service memory starts at 13 MB, grows as high as 8500 MB, and finishes at 3734 MB

    Export 2: export service memory starts at 3734 MB, grows as high as 8500 MB, and finishes at 3735 MB

    Export 3: export service memory starts at 3735 MB, grows as high as 8500 MB, and finishes at 90.3 MB

    Export 4: export service memory starts at 90.3 MB, grows as high as 8500 MB, and finishes at 90.5 MB

    Export 5: export service memory starts at 90.5 MB, grows as high as 8500 MB, and finishes at 90.5 MB

    Page Report export:

    Result: a spreadsheet with 26 columns and 15,249 rows

    I began the test by restarting the Export Service.

    Export 1: export service memory starts at 13 MB, grows as high as 1615 MB, and finishes at 505 MB

    Export 2: export service memory starts at 505 MB, grows as high as 2127 MB, and finishes at 970 MB

    Export 3: export service memory starts at 970 MB, grows as high as 3059 MB, and finishes at 1436 MB

    Export 4: export service memory starts at 1436 MB, grows as high as 4032 MB, and finishes at 1902 MB

    Export 5: export service memory starts at 1902 MB, grows as high as 5105 MB, and finishes at 2367 MB

    Export 6: export service memory starts at 2367 MB, grows as high as 6267 MB, and finishes at 2830 MB

    Conclusion: It looks like the Export Service does not reset to its minimum memory usage during the PageReport export process the same way that it does during the SectionReport export process.

    Thanks,

    Anwar

  • Posted 8 December 2017, 3:41 am EST

    I am using Excel Rendering extension for PageReport Excel export. Is there a way that i can Dispose the GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider.

    http://help.grapecity.com/activereports/webhelp/AR10/RenderingtoExcel.html

    GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension excelRenderingExtension = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension();

    GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();

    doc.Render(excelRenderingExtension, outputProvider, excelSetting.GetSettings());

                                outputProvider.GetPrimaryStream().OpenStream().CopyTo(returnStream);
                                returnStream.Position = 0;
    
  • Posted 10 December 2017, 4:41 pm EST

    Hello,

    Both PageReport and SectionReport have the same disposing method. Could you please recheck after upgrading it to AR11 SP2 as lot of memory leak issues have fixed in AR11 Sp2. You can download the AR11 Sp2 from the following link:

    http://cdn.grapecity.com/ActiveReports/ar11/hotfixes/ActiveReports-v11.2.11844.0.msi

    Also, you can dispose the GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider object setting it to “Null”. You can use the following code:

    outputProvider = null;

    If issue still exits, please share the sample application with us to replicate the behavior.

    Hope it helps.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels