Using the two Viewer in the One Project
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.Two independent dashboard viewers can live on one page, each bound to its own report object.
In React.
How it works. The viewer is a self-contained component, so any number can be placed on a page, each with a separate dashboard.
In React.
import { Viewer, Stimulsoft } from "stimulsoft-dashboards-js-react/viewer";
function App() {
var report1 = new Stimulsoft.Report.StiReport();
report1.loadFile("Dashboards/Dashboard.mrt");
var report2 = new Stimulsoft.Report.StiReport();
report2.loadFile("Dashboards/Orders.mrt");
return (
<>
<Viewer report={report1} />
<Viewer report={report2} />
</>
);
}- Each
Viewergets its ownStiReport, so the two dashboards render and operate independently. - The components share no state — loading or interacting with one does not affect the other.
How it works. The viewer is a self-contained component, so any number can be placed on a page, each with a separate dashboard.