When rendering server-side, data can be registered through the onBeforeRender event, which runs in the Node.js engine.

Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
$report = new StiReport();
$report->engine = StiEngineType::ServerNodeJS;
$report->onBeforeRender = '
    let dataSet = new Stimulsoft.System.Data.DataSet("Demo");
    dataSet.readJson(jsonData);
    args.report.dictionary.databases.clear();
    args.report.regData("Demo", "Demo", dataSet);
';
$report->process();
$report->loadFile('reports/SimpleList.mrt', true);
$report->render();



The onBeforeRender script runs inside the server-side engine just before rendering, letting you attach data to a headless render exactly as you would in the browser.

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.