Assigning a Report to the Viewer
Our sample projects and report templates can help you learn the basics of working with our products.This example shows how to load a report and assign it to the viewer. You need to create the report object of the
In the screenshot below you can see the result of the sample code:

StiReport type, then load the report template file by calling the loadFile() method. To display report in the viewer you can simply assign a report object to the report property of the viewer. If the report is not rendered, the viewer renders it automatically:
<script type="text/javascript">
// Create the report viewer with default options
var viewer = new Stimulsoft.Viewer.StiViewer(null, "StiViewer", false);
// Create a new report instance
var report = new Stimulsoft.Report.StiReport();
// Load report from url
report.loadFile("../reports/SimpleList.mrt");
// Assign report to the viewer, the report will be built automatically after rendering the viewer
viewer.report = report;
</script>In the screenshot below you can see the result of the sample code:
