Exporting a Report to HTML
Our sample projects and report templates can help you learn the basics of working with our products.Render the report in Node.js 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.
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(() => {
var htmlString = report.exportDocument(Stimulsoft.Report.StiExportFormat.Html);
fs.writeFileSync('./SimpleList.html', htmlString);
});For HTML the synchronous exportDocument returns the markup as a string, which is written to a file with fs.writeFileSync. Passing a different StiExportFormat value exports to PDF, Excel, Word and other formats the same way.