When exporting on the server, data can be registered in the onBeforeRender event — supplied as client JavaScript run by the Node.js engine.

Register data, then export.
$report = new StiReport();
$report->engine = StiEngineType::ServerNodeJS;

$report->onBeforeRender = '
    let dataSet = new Stimulsoft.System.Data.DataSet("Demo");
    dataSet.readXmlSchemaFile("data/Demo.xsd");
    dataSet.readXmlFile("data/Demo.xml");
    args.report.dictionary.databases.clear();
    args.report.regData("Demo", "Demo", dataSet);
';

$report->process();
$report->loadFile('reports/ProductStats.mrt', true);
$result = $report->exportDocument(StiExportFormat::Html);

How it works. The data-registration script runs inside the Node.js engine, so a headless export can bind data exactly as the browser would.

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.