Category / Section
How to dispose the export event when dynamically changing the report
1 min read
Dispose the export event
If we changing the Report Path dynamically to load the report in Report Viewer then the export content is not refreshing. So we need to use _destory method with ReportViewer before creating the new instance to load the report
var reportviewerObj = $("#reportViewerTagID").data("ejReportViewer"); reportviewerObj. _destroy()
For example please find the below code sample.
<script type="text/javascript"> var coundid = 1; function ShowReport() { coundid = coundid+ 1; $("#ejdReportViewer").ejDialog({ contentUrl: "/Home/ShowReports?setName=" + coundid, actionButtons: ["close", "maximize"], height: 900 }); $("#ejdReportViewer").ejDialog("open"); $("#ejdReportViewer").ejDialog({ close: function (args) { var reportviewerObj = $("#rvReport").data("ejReportViewer"); reportviewerObj._destroy(); } }); } </script>