Showing a Report in the Viewer in an HTML template
Our sample projects and report templates can help you learn the basics of working with our products.When you build the page yourself, you can output the viewer's scripts and body separately so they fit your HTML layout.
Viewer setup. Configure the viewer, load the report, assign it to the component, and process the requests or events raised by the UI.
Viewer setup. Configure the viewer, load the report, assign it to the component, and process the requests or events raised by the UI.
<head>
<?php $viewer->javascript->renderHtml(); ?>
</head>
<body>
<?php $viewer->renderHtml(); ?>
</body>javascript->renderHtml()— prints only the required<script>tags; place this call inside the<head>.renderHtml()— prints only the viewer element itself; place this call where the viewer should appear in the<body>.
javascript->renderHtml() emits the required scripts (placed in the head), while renderHtml() emits the viewer element itself. This gives you full control over where the viewer sits in your own template.