855.367.3511 | CONTACT US

Author Topic: How to run code after the report has finished loading  (Read 3545 times)

jon

  • Newbie
  • *
  • Posts: 9
    • View Profile
How to run code after the report has finished loading
« on: September 18, 2014, 01:25:55 pm »
If you need to run code after the report has finished loading you can bind to the After Load Report event like so:

Code: [Select]
<script type="text/javascript">
    $(document).ready(function () {
        var $reportViewerEZ = $("body");
        var events = forerunner.ssr.constants.events;
        $reportViewerEZ.on(events.reportViewerAfterLoadReport(), function (e, data) {
            console.log(events.reportViewerAfterLoadReport());
            console.log(data);
        });
    });
</script>

I just used the body to bind to the event, it would be more correct for you to use the Report Viewer EZ <div> in your application. I dumped out the data object to the console as well as the event string. It might be interesting to look at the data object members.
« Last Edit: September 18, 2014, 01:27:29 pm by jonto »
Jon Totton, Forerunner Software, Director of Development