Exporting a Dashboard to PDF
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.The dashboard engine runs headless on Node.js — a dashboard can be rendered and exported to PDF without a browser.
Load and export to a file.
How it works. The same engine that powers the browser viewer runs on the server, so dashboards can be generated from schedulers or services.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Load and export to a file.
var Stimulsoft = require('stimulsoft-dashboards-js');
var report = Stimulsoft.Report.StiReport.createNewDashboard();
report.loadFile("Dashboard.mrt");
report.exportDocumentAsync(function (pdfData) {
var buffer = Buffer.from(pdfData);
require('fs').writeFileSync('./Dashboard.pdf', buffer);
}, Stimulsoft.Report.StiExportFormat.Pdf);require('stimulsoft-dashboards-js')— the dashboard engine as a Node module.exportDocumentAsync(callback, StiExportFormat.Pdf)→Buffer.from(data)+fs.writeFileSync— render and save the file.
How it works. The same engine that powers the browser viewer runs on the server, so dashboards can be generated from schedulers or services.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
