Saving the Rendered Report to a File
Our sample projects and report templates can help you learn the basics of working with our products.A rendered report can be saved as a document file (.mdc) so it can be reloaded later without re-rendering.
Saving the template. Load or edit the report, handle the save action, serialize the updated template, and write or return it through the application workflow.
Saving the template. Load or edit the report, handle the save action, serialize the updated template, and write or return it through the application workflow.
var report = new Stimulsoft.Report.StiReport();
report.loadFile("../reports/SimpleList.mrt");
report.renderAsync(function () { });
function saveReportDocument() {
var json = report.saveDocumentToJsonString();
var fileName = report.reportAlias;
Stimulsoft.System.StiObject.saveAs(json, fileName + ".mdc", "application/json;charset=utf-8");
}saveDocumentToJsonString serializes the rendered document (not the template) to a string. Saved as an .mdc file, it can be loaded later with loadDocumentFile to display the exact same result instantly.