Exporting a Dashboard from Code on the Server-Side
Our sample projects and report templates can help you learn the basics of working with our products.With the Node.js engine, a dashboard can be rendered and exported entirely on the server — no browser involved. The result comes back as byte data.
Export via the Node.js engine.
How it works. Node.js runs the engine server-side, so the export completes without a client, ideal for scheduled or headless generation.
Export via the Node.js engine.
$report = new StiReport();
$report->engine = StiEngineType::ServerNodeJS;
$report->process();
$report->loadFile('reports/Christmas.mrt');
$result = $report->exportDocument(StiExportFormat::Html);
// $report->exportDocument(StiExportFormat::Pdf, null, false, 'reports/Christmas.pdf');
$message = $result !== false ? 'Done.' : $report->nodejs->error;$report->engine = StiEngineType::ServerNodeJS— render on the server with Node.js instead of the browser.$report->exportDocument(format)— returns the document bytes; pass a path to save it to a file instead.
How it works. Node.js runs the engine server-side, so the export completes without a client, ideal for scheduled or headless generation.