This example shows how to load a report and assign it to the viewer. You need to create the report object of the 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:

Assigning a Report to the Viewer

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.