Using Viewer Events
Our sample projects and report templates can help you learn the basics of working with our products.The dashboard viewer exposes its events as component bindings — here the export event fires when the user exports the dashboard.
In React.
How it works. Each event is a component output, so your app reacts to what the user does in the viewer.
In React.
import { Viewer, Stimulsoft } from "stimulsoft-dashboards-js-react/viewer";
function App() {
var report = new Stimulsoft.Report.StiReport();
report.loadFile("Dashboards/Dashboard.mrt");
var options = new Stimulsoft.Viewer.StiViewerOptions();
options.toolbar.showSendEmailButton = true;
function onBeginExportReport(args: Stimulsoft.Viewer.BeginExportReportArgs) {
alert("onBeginExportReport");
}
return <Viewer options={options} report={report} onBeginExportReport={onBeginExportReport} />;
}onBeginExportReport— bound as a component event; the handler receivesBeginExportReportArgs.- Other events (print, data, design) bind the same way.
How it works. Each event is a component output, so your app reacts to what the user does in the viewer.