When the user exports a dashboard, the result can be sent back to the server and saved, through the 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();

How it works. The export travels from the client viewer to the PHP event, so exported dashboards can be archived on the server automatically.

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.