Handle onOpenedReport in the PHP viewer to modify a report before it reaches the browser.

Viewer setup. Configure the viewer, load the report, assign it to the component, and process the requests or events raised by the UI.
$viewer->onOpenedReport = function (StiReportEventArgs $args) {
    $args->report->ReportAlias = 'Report Alias from Server-Side';
    $reportJsonString = file_get_contents('../reports/SimpleList.mrt');
    $args->setReportJson($reportJsonString);
};
$viewer->process();


The event lets you inspect and replace the report on the server — here it changes a property and swaps in a different template — before the viewer displays it to the user.

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.