Exporting a Dashboard to Excel
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.On Node.js a dashboard can be rendered and exported to an Excel workbook without a browser.
Load and export to Excel.
How it works. The export format is just an enum value, so the same headless flow produces Excel, PDF and other formats.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Load and export to Excel.
var Stimulsoft = require('stimulsoft-dashboards-js');
var report = Stimulsoft.Report.StiReport.createNewDashboard();
report.loadFile("Dashboard.mrt");
report.exportDocumentAsync(function (excelData) {
var buffer = Buffer.from(excelData);
require('fs').writeFileSync('./Dashboard.xlsx', buffer);
}, Stimulsoft.Report.StiExportFormat.Excel2007);exportDocumentAsync(callback, StiExportFormat.Excel2007)— render the dashboard to XLSX bytes.Buffer.from(data)+fs.writeFileSync— write the workbook to disk.
How it works. The export format is just an enum value, so the same headless flow produces Excel, PDF and other formats.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
