Showing a Report in the Viewer
Our sample projects and report templates can help you learn the basics of working with our products.In Laravel the viewer lives in a Blade view; it points its event handler at a route and loads a report template.
Set up the viewer in the Blade view.
How it works. The Blade view wires the viewer to Laravel's routing, so report requests are handled by a controller while rendering stays on the client.
Set up the viewer in the Blade view.
$viewer = new StiViewer();
// Route events to the handler controller
$viewer->handler->url = "/handler";
$viewer->onPrepareVariables = true;
$report = new StiReport();
$report->loadFile("reports/SimpleList.mrt");
$viewer->report = $report;$viewer->handler->url = "/handler"— sends the viewer's server callbacks to a Laravel route/controller.$viewer->onPrepareVariables = true— enables the variables event so the controller can supply values.$report->loadFile(...)— generates the client code to load the template; the report loads in the browser.
How it works. The Blade view wires the viewer to Laravel's routing, so report requests are handled by a controller while rendering stays on the client.