Data can be registered for the dashboard just before it renders, through the onBeforeRender event handled in client JavaScript.

Assign the event, load the dashboard.
$report = new StiReport();
$report->onBeforeRender = 'onBeforeRender';

$viewer->process();
$report->loadFile('../reports/ProductStats.mrt');
$viewer->report = $report;
Build and register data in the event.
function onBeforeRender(args) {
    let dataSet = new Stimulsoft.System.Data.DataSet("Demo");
    dataSet.readXmlSchemaFile("../data/Demo.xsd");
    dataSet.readXmlFile("../data/Demo.xml");
    args.report.regData("Demo", "Demo", dataSet);
}

How it works. The dashboard receives its data right before rendering, so the template need not carry its own connections.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.