Showing the Viewer in a Required Position
Our sample projects and report templates can help you learn the basics of working with our products.This example shows how to create a report viewer and show it in desired position. If you want to disable the automatic rendering of the viewer content after creation, set the third parameter of the constructor to
To display the report viewer you can use the
Also you can render the viewer content into the specified HTML element, for example DIV. For this you can use the
In the screenshot below you can see the result of the sample code:

false. In this case, the object viewer will be created in memory:
<script type="text/javascript">
// Create the report viewer with default options
var viewer = new Stimulsoft.Viewer.StiViewer(null, "StiViewer", false);
...
</script>
To display the report viewer you can use the
viewer.renderHtml() method, viewer renders its own content in the place, in which this method was called:
<script type="text/javascript">
// Show the report viewer in this place
viewer.renderHtml();
</script>
Also you can render the viewer content into the specified HTML element, for example DIV. For this you can use the
viewer.renderHtml("elementId") method:
<script type="text/javascript">
// Show the report viewer in specified element
viewer.renderHtml("viewerContent");
</script>
...
<div id="viewerContent">
</div>In the screenshot below you can see the result of the sample code:
