Printing the Dashboard from Code
Our sample projects and report templates can help you learn the basics of working with our products.A dashboard can be sent to the printer straight from code — as PDF or as HTML.
In React.
How it works. The report object handles rendering and hands the result to the browser's print flow, so no viewer is required.
In React.
import { Stimulsoft } from "stimulsoft-dashboards-js-react";
var report: Stimulsoft.Report.StiReport;
function printPdf_Click() { report.printToPdf(); }
function printHtml_Click() { report.print(); }
function App() {
report = new Stimulsoft.Report.StiReport();
report.loadFile("Dashboards/Dashboard.mrt");
return (
<>
<button onClick={printPdf_Click}>Print PDF</button>
<button onClick={printHtml_Click}>Print HTML</button>
</>
);
}report.printToPdf()— render and print the dashboard through the PDF print path.report.print()— print via the HTML path; both open the browser print dialog.
How it works. The report object handles rendering and hands the result to the browser's print flow, so no viewer is required.