This example shows how to display a report in the
Stimulsoft Designer without additional event handling. First, include the Stimulsoft libraries:
<?php
require_once '../vendor/autoload.php';
use Stimulsoft\Designer\StiDesigner;
use Stimulsoft\Report\StiReport;
?>
Next, create a
Designer object and configure JavaScript-related options:
$designer = new StiDesigner();
$designer->javascript->relativePath = '../';
$designer->javascript->appendHead('<link rel="shortcut icon" href="/../favicon.ico" type="image/x-icon">');
Process any incoming requests using
process():
$designer->process();
Create a
Report object and load a report template. The
loadFile() method does not load the report on the server side; it only generates the necessary JavaScript code for the client side:
$report = new StiReport();
$report->loadFile('../reports/SimpleList.mrt');
Assign the report to the designer:
$designer->report = $report;
Finally, render the designer as a complete HTML page using
printHtml():
$designer->printHtml();
In the screenshot below you can see the result of the sample code: