Showing a Dashboard in the Viewer
Unsere Beispiele der Projekte und Berichtsvorlagen helfen Ihnen, die Grundlagen der Arbeit mit unserer Software zu erlernen.This example shows how to show a dashboard in the Stimulsoft Viewer using PHP. First, include the necessary libraries:
Create a Viewer object and set JavaScript options:
Process requests using the process() method:
Create a report object and load a dashboard template from a file using loadFile():
Assign the report to the viewer:
Finally, render the visual HTML part of the Viewer with printHtml():
Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen:

<?php
require_once '../vendor/autoload.php';
use Stimulsoft\Report\StiReport;
use Stimulsoft\Viewer\StiViewer;
?>
Create a Viewer object and set JavaScript options:
$viewer = new StiViewer();
$viewer->javascript->relativePath = '../';
$viewer->javascript->appendHead()('<link rel="shortcut icon" href="/../favicon.ico" type="image/x-icon">');
Process requests using the process() method:
$viewer->process();
Create a report object and load a dashboard template from a file using loadFile():
$report = new StiReport();
$report->loadFile()('../reports/Christmas.mrt');
Assign the report to the viewer:
$viewer->report = $report;
Finally, render the visual HTML part of the Viewer with printHtml():
$viewer->printHtml();Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen:
