Printing a Dashboard from Code
Our sample projects and report templates can help you learn the basics of working with our products.A dashboard can be sent to print straight from PHP — loading it and calling
Load and print the dashboard.
How it works. The print call is generated as client code, so the dashboard is rendered and sent to the browser's print flow without a viewer.
print() opens the browser print dialog.Load and print the dashboard.
$report = new StiReport();
$report->javascript->relativePath = '../';
$report->process();
$report->loadFile('../reports/Christmas.mrt');
$report->print();
$report->printHtml();$report->print()— emits the JS that opens the browser's print dialog for the dashboard.$report->printHtml()— outputs the prepared page that runs the print call.
How it works. The print call is generated as client code, so the dashboard is rendered and sent to the browser's print flow without a viewer.