Editing a Report in the Designer
Our sample projects and report templates can help you learn the basics of working with our products.The Reports.PHP designer embeds in a Laravel application the same way as the viewer, letting users edit report templates in the browser.
Rendering the designer. The Blade view creates the designer, routes its events to the handler and enables the save event, then loads a report:
Rendering the designer. The Blade view creates the designer, routes its events to the handler and enables the save event, then loads a report:
use Stimulsoft\Designer\StiDesigner;
use Stimulsoft\Report\StiReport;
$designer = new StiDesigner();
// Redirect component events to the handler controller
$designer->handler->url = "/handler";
$designer->onSaveReport = true;
$report = new StiReport();
$report->loadFile("reports/SimpleList.mrt");
$designer->report = $report;
$designer->printHtml();Setting onSaveReport = true makes the designer send the edited template to the /handler route, where the controller can persist it. As with the viewer, printHtml() renders the designer interface as a prepared HTML page.