Sending an Exported Dashboard to the Server-Side
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.When the user exports a dashboard, the result can be sent back to the server and saved, through the
Save the exported bytes in the event.
How it works. The export travels from the client viewer to the PHP event, so exported dashboards can be archived on the server automatically.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

onEndExportReport event.Save the exported bytes in the event.
$viewer->onEndExportReport = function (StiExportEventArgs $args) {
$reportName = $args->fileName . '.' . $args->fileExtension;
$reportPath = "../reports/$reportName";
file_put_contents($reportPath, base64_decode($args->data));
return StiResult::getSuccess("Saved to '$reportPath'.");
};
$viewer->handler->process();onEndExportReport— fires after an export;$args->dataholds the base64-encoded document.base64_decode($args->data)+file_put_contents— write the exported dashboard to disk.
How it works. The export travels from the client viewer to the PHP event, so exported dashboards can be archived on the server automatically.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
