Skip to main content

Handle the Report Designer's Client-Side Events

  • 3 minutes to read

The Web Report Designer includes an advanced client-side API in addition to the comprehensive server-side object model. This enables web applications based on this control to function more efficiently by combining server-side and client-side processing.

Report Designer’s Events

The ReportDesignerClientSideEventsBuilder class exposes methods that allow you to pass client-side events’ handlers. To access this class instance, use the ReportDesignerBuilder.ClientSideEvents method.

<script type="text/javascript" id="script"> 
    function customizeMenuActions(s, e) {
        // Get the "Save" action and hide it.
        var saveAction = e.GetById(DevExpress.Reporting.Designer.Actions.ActionId.Save);
        if (saveAction)
            saveAction.visible = false;
    }
</script>
@{
    var designer = Html.DevExpress().ReportDesigner("reportDesigner1")
        .Height("1000px")
        .Bind(Model.Report)
        .ClientSideEvents(configure => { configure.CustomizeMenuActions("customizeMenuActions"); });
}
@designer

The Report Designer’s client-side events allow you to perform the following actions:

Document Viewer’s Events

You can also handle client-side events for the Report Designer’s integrated Document Viewer.

The ReportDesignerPreviewClientSideEventsBuilder class exposes methods that allow you to pass these handlers. To access this class instance, use the ReportDesignerClientSideEventsBuilder object’s Preview method. This object is available in the ReportDesignerBuilder.ClientSideEvents method.

<script type="text/javascript" id="script"> 
    function previewCustomizeElements(s, e) {
        var rightPanel = e.GetById(DevExpress.Reporting.Viewer.PreviewElements.RightPanel);
        var index = e.Elements.indexOf(rightPanel);
        e.Elements.splice(index, 1);
    }
</script>
@(Html.DevExpress().ReportDesigner("reportDesigner1")
        .Height("1000px")
        .ClientSideEvents(configure => {
            configure.Preview(c => { c.CustomizeElements("previewCustomizeElements"); });
        })
        .Bind(Model.Report))

The events listed below allow you to customize the built-in Document Viewer and respond to user actions.

Event Description
PreviewClick Occurs when a report document is clicked.
CustomizeElements Enables you to customize UI elements.
CustomizeMenuActions Allows you to customize toolbar actions.
CustomizeExportOptions Allows you to customize export formats and corresponding export options.
DocumentReady Occurs after a report has been switched to Print Preview.
EditingFieldChanged Occurs each time an editing field’s value changes.
ParametersReset Occurs after report parameter values are reset to their default values.
ParametersSubmitted Occurs after report parameter values are submitted.