Render the report in JavaScript and export it directly from code, without opening the viewer.

Exporting the document. Load and render the report, configure the requested export format, and deliver the generated bytes as a file, stream, or web response.
var report = new Stimulsoft.Report.StiReport();
report.loadFile("../reports/SimpleList.mrt");
report.renderAsync(function () { });

function saveReportPdf() {
    report.exportDocumentAsync(function (pdfData) {
        var fileName = report.reportAlias;
        Stimulsoft.System.StiObject.saveAs(pdfData, fileName + ".pdf", "application/pdf");
    }, Stimulsoft.Report.StiExportFormat.Pdf);
}
exportDocumentAsync exports the rendered report to the format given by StiExportFormat and returns the data in a callback. The helper Stimulsoft.System.StiObject.saveAs then prompts the browser to download the file.

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.