Cache to disk not working in AR13.1?

Posted by: jl on 26 June 2019, 8:29 pm EST

    • Post Options:
    • Link

    Posted 26 June 2019, 8:29 pm EST

    Have a complex report that works fine in AR12.2. Did upgrade to AR13.1 (latest) and did run same report. id did notice that A lot of memory (about 2Gb) where allocated and get the Out of memory error in the .Run cmd.

    I use the %temp% folder as cachetodisk path and can see that tmp files are created but byte size is “0” for every file…

    When i run same report in AR12.2 the tmp files are growing as the report progress. and memory consuming is about 400Mb vs 2Gb

    …Jorgen

  • Posted 30 June 2019, 9:57 pm EST

    Hello,

    Could you please share the build number that you are using.

    Also, please check with the following hotfix build:

    http://cdn.grapecity.com/ActiveReports/AR13/hotfixes/ActiveReports-v13.1.17570.0.msi

    If the issue still occurs, could you please share the sample of code and the report layout.

    Thanks.

  • Posted 1 July 2019, 8:10 pm EST

    Hello mohitg !

    The link to the AR13 hotfix made my report come up and it worked 1st time in debug x86, the second time i run it i got out of memory…

    The memory consumption peaked at 1Gb ram but dropped down and peaked up 1Gb a couple of times.

    Its difficult to send you code samples for this but i provided the files in attached file.

    We have a global SectionReport document where we Add pages for each report that is created.

    The main loop for the report that we get the error in is like this:

    pdoc6_A4p = new Rpt6.Rpt06_A4p();

    pdoc6_A4p.Document.Name = Properties.Resources.IDS_RappName_6;

    pdoc6_A4p.strXmlFile = strXmlFile;

    pdoc6_A4p.iStartPage = iStartPage;

    pdoc6_A4p.bMultiRpt = bMultiRpt;

    pdoc6_A4p.Document.CacheToDisk = true;

    pdoc6_A4p.Document.CacheToDiskLocation = System.IO.Path.GetTempPath();

    try

    {

    pdoc6_A4p.Run(true); <— Here it stops with exception after a while …

    }

    catch (Exception err)

    {

    MessageBox.Show(err.Message, “Rpt6”, MessageBoxButtons.OK,

    MessageBoxIcon.Error);

       pdoc6_A4p.Dispose();
       pdoc6_A4p = null;
      throw;
    

    }

    pdoc6_A4p.Document.Bookmarks.Clear();

    Bookmark bk = new Bookmark();

    bk.Label = Properties.Resources.IDS_RappName_6;

    bk.PageNumber = iStartPage;

    pDoc.Document.Bookmarks.Add(bk);

    for (int i = 0; i < pdoc6_A4p.Document.Pages.Count; i++)

    {

    pDoc.Document.Pages.Add(pdoc6_A4p.Document.Pages[i]);

    }

    the build i was running in AR12: 12.2.13986.0

    SectReport.zip

  • Posted 2 July 2019, 6:12 pm EST

    Hello,

    What I understood from this, you got an exception on executing the report second time in the same application instance. You are facing the same problem with AR12 and AR13. If my understanding is correct then please dispose the report object before executing it the second time. Using the following line of code to dispose the object:

    rpt.Document.Dispose();
    rpt.Dispose();
    rpt=null;
    

    Please explain if my understanding is incorrect. Also If the problem occurs while executing the application second time, then please after using the above code in FormClosing event.

    Hope it helps.

    Thanks.

  • Posted 2 July 2019, 7:07 pm EST

    Hello,

    In AR12 i do not get any error, and can execute the report several times without closing the application.

    And if i add “pdoc6_A4p.Document.Dispose();” i get error in the main report document “pDoc” because we “Add” all pages from “pdoc6_A4p” to the “pDoc” object in this example.

    The “pDoc” is loaded into viewer later on when all reports are generated.

    …Jorgen

  • Posted 3 July 2019, 10:10 pm EST

    Hello,

    I have escalated to the development team(273831) and will inform you once I get any reply from them.

    Thanks.

  • Posted 17 July 2019, 10:14 pm EST

    Hello,

    Is there any reason that you do not assign the static resources like image in the ReportStart event handler.

    Thanks,

  • Posted 31 July 2019, 9:37 pm EST

    The only image i assign dynamic in report is the Company logotype in the ReportStart event. ?

    All other images is assigned in subreports detail/group section. Can i save memory consumption if i add the ReportStart event for each of the subreports and assign the images in the event instead ?

    …JL

  • Posted 31 July 2019, 10:26 pm EST

    Hello Jorgan,

    If the image is the same throughout the report then I will recommend you to set in the ReportStart event. It will save memory consumption in the report.

    However, if the image is different in every detail section then I will recommend you to set in the Format event of Detail section. Also, we are working on the hotfix for you.

    Hope it clarifies.

    Thanks.

  • Posted 3 September 2019, 3:35 pm EST

    Hello,

    Your issue is fixed in AR 13 Sp2. You can download it from the following link:

    https://global-cdn.grapecity.com/downloads/activereports/ActiveReports-v13.2.18250.0.msi

    Thanks.

  • Posted 4 September 2019, 10:37 pm EST

    Hello,

    It works :slight_smile:

    The memory never went above 450Kb with this version.

    Thanks for all help.

    …Jorgen

Need extra support?

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

Learn More

Forum Channels