Notice

 

When a report is assigned to a viewer component, it is automatically generated. You only need to call the report.render() method if you want to perform specific actions with the rendered report before it is displayed in the viewer.

 

 

 

To display a report in the viewer you should create the StiReport object, load a report template to it, and assign a received object to the viewer. All other actions will be done automatically, the viewer will render a report and display the first page.

 

viewer.php

 

<?php

$report = new \Stimulsoft\Report\StiReport();

$report->loadFile('reports/SimpleList.mrt');

 

$viewer = new \Stimulsoft\Viewer\StiViewer();

$viewer->report = $report;

$viewer->renderHtml();

?>

 

 

 

The viewer can render and display both report templates and documents (rendered reports). You can find more detailed information with various report formats and documents in the Loading and Saving Reports chapter.