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.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.