Events

The ReportViewer has the following client-side events support to listen to the control action.

Events Description
destroy Fires when the ReportViewer is destroyed.
drillThrough Fires during drill through action done in report and event can be canceled.
renderingBegin Fires before report rendering is completed.
renderingComplete Report loaded method that is triggered when report and sub report begin loading.
reportError Fires when any error occurs while rendering the report and event can be canceled.
reportLoaded Fires when the report is loaded.
  • html
  • @(Html.EJ().ReportViewer("viewer")
    .ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Local)
    .ReportPath("DatabindingRemote.rdlc")
    .ReportServiceUrl(VirtualPathUtility.ToAbsolute("~/api/RDLCReport")).ReportLoaded("reportLoaded") )
    
    
    <script type="text/javascript">
        function reportLoaded(senderObj) {
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: '../wcf/Reportservice.svc/GetOrderDetails',
                dataType: "json",
                processData: false,
                crossDomain: true,
                async: false,
                timeout: 5000,
                success: function (result) {
                    reportdata = result.d;
                    var dataManger = ej.DataManager(reportdata);
                    var query = ej.Query().select("OrderID", "CustomerID", "EmployeeID", "Freight", "ShipCity", "ShipCountry");
                    reportResult = dataManger.executeLocal(query);
                    var reportModel = $("#viewer").data('ejReportViewer');
                    reportModel.model.dataSources = [{ value: reportResult, name: "remote" }];
                },
                error: function (result) {
                    alert(result);
                }
            });
        }
    </script>