A report can be rendered and sent to print directly from PHP code. This example loads a report, renders it, and prints it.

Printing from code. Load and render the report, apply the printer settings, and start the print workflow from application code.
$report = new StiReport();
$report->javascript->relativePath = '../';
$report->process();
$report->loadFile('../reports/SimpleList.mrt');
$report->render();
$report->print();
$report->printHtml();


render() builds the document and print() opens the browser print dialog for it; printHtml() outputs the page with the required scripts so printing runs 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.