Showing a Dashboard in the Viewer using JavaScript
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.The viewer can be built entirely in client JavaScript, with PHP acting only as the
Process requests in PHP.
How it works. The dashboard renders in the browser; PHP is contacted only when the viewer needs data, keeping the server role minimal.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

StiHandler request handler.Process requests in PHP.
$handler = new StiHandler();
$handler->process();Build the viewer in JavaScript. Include stimulsoft.dashboards.js alongside the report scripts:let viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
viewer.onBeginProcessData = (args, callback) => Stimulsoft.handler.process(args, callback);
let report = new Stimulsoft.Report.StiReport();
report.loadFile("../reports/Christmas.mrt");
viewer.report = report;
viewer.renderHtml("viewerContent");StiHandler->process()— the PHP side answering the viewer's data/event requests.onBeginProcessData→Stimulsoft.handler.process— routes client data requests to the PHP handler.
How it works. The dashboard renders in the browser; PHP is contacted only when the viewer needs data, keeping the server role minimal.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
