A report is configured and loaded in PHP, but rendered by the JavaScript engine on the client — a callback fires when the build finishes.

Configure and load in PHP.
$report = new StiReport();
$report->javascript->relativePath = '../';
$report->onAfterRender = 'onAfterRender';
$report->process();

$report->loadFile('../reports/SimpleList.mrt');
$report->render();
Handle the result in JavaScript.
function onAfterRender(args) {
    // args.report is the rendered document
    let pages = args.report.renderedPages.count;
    let json = args.report.saveDocumentToJsonString();
}

How it works. PHP only generates the engine code; the actual rendering — and the resulting document — lives entirely in the browser.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.