For very large reports, cache mode keeps memory usage low by holding only part of the rendered document in memory at a time.

Cache lifecycle. Choose a stable cache key, store the report between requests, and restore it before the next viewer or designer action.
var Stimulsoft = require('stimulsoft-reports-js');

var report = new Stimulsoft.Report.StiReport();
report.loadFile("Over-2.000-pages.mrt");

report.reportCacheMode = Stimulsoft.Report.StiReportCacheMode.On;
Stimulsoft.StiOptions.Engine.ReportCache.amountOfQuickAccessPages = 50; // default 50

report.renderAsync(() => {
    console.log("Pages: ", report.renderedPages.count);
    report.saveDocumentFile("Over-2.000-pages.mdc");
    report.dispose();
});
Setting reportCacheMode = On streams rendered pages to a cache instead of keeping them all in memory; amountOfQuickAccessPages controls how many stay readily available. Calling dispose() afterwards frees the resources — important for long-running Node.js services.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.