Exporting a Dashboard to HTML
Our sample projects and report templates can help you learn the basics of working with our products.A dashboard can be rendered and exported to an HTML file straight from code, then saved in the browser.
In React.
How it works. Only the export format differs from the PDF case — the same render-then-save flow produces HTML.
In React.
import { Stimulsoft } from "stimulsoft-dashboards-js-react";
async function saveDashboardHtml() {
var report = new Stimulsoft.Report.StiReport();
report.loadFile("Dashboards/Dashboard.mrt");
await report.renderAsync2();
var htmlData = await report.exportDocumentAsync2(Stimulsoft.Report.StiExportFormat.Html);
Stimulsoft.System.StiObject.saveAs(htmlData, report.reportAlias + ".html", "text/html;charset=utf-8");
}
function App() {
return <button onClick={saveDashboardHtml}>Export to HTML</button>;
}exportDocumentAsync2(StiExportFormat.Html)— export the rendered dashboard to HTML bytes.StiObject.saveAs(data, name, "text/html;charset=utf-8")— save the result as a file.
How it works. Only the export format differs from the PDF case — the same render-then-save flow produces HTML.