Reports can be rendered and exported to PDF entirely on the server. This example renders a template and writes the PDF to a file.

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 Stimulsoft = require('stimulsoft-reports-js');

var report = new Stimulsoft.Report.StiReport();
report.loadFile("SimpleList.mrt");

report.renderAsync(() => {
    report.exportDocumentAsync((pdfData) => {
        var buffer = Buffer.from(pdfData);
        fs.writeFileSync('./SimpleList.pdf', buffer);
    }, Stimulsoft.Report.StiExportFormat.Pdf);
});
exportDocumentAsync returns the PDF as a byte array; wrapping it in a Node Buffer and calling fs.writeFileSync saves it to disk. This is the basis for server-side report delivery, e-mail attachments and scheduled exports.

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.