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:
Customize Report Designer Elements and Actions
Event Description Customize Wizard Enables you to customize the Report Wizard and Data Source Wizard. Customize Elements Enables you to customize UI elements. Customize Menu Actions Allows you to customize menu actions. Customize Field List Actions Enables you to customize actions in the Field List. Respond to Opening and Saving Reports
Event Description Report Opening Occurs when a report is about to be opened in the Report Designer. Report Opened Occurs when a report has been opened in the Report Designer. Report Saving Occurs when a report is about to be saved in the Report Designer. Report Saved Occurs when a report has been saved in the Report Designer. Customize the Save and Open Dialogs
Event Description Customize Open Dialog Enables you to customize the Open Report dialog. Customize Save Dialog Enables you to customize the Save dialog. Customize Save As Dialog Enables you to customize the Save Report dialog. Respond to Changing and Closing Report Tabs
Event Description Tab Changed Occurs when an active report tab was changed. Report Tab Closing Occurs when a report tab is about to be closed. Report Tab Closed Occurs when a report tab was closed. Exit Designer Occurs when the Report Designer is being closed. Customize Controls and Their Properties
Event Description Customize Toolbox Enables you to customize the Toolbox. Component Added Occurs after a component has been added to the current report. Localize the Report Designer
Event Description Customize Localization Enables you to substitute the Report Designer’s localization strings with custom strings. Customize Parameter Editors
Event Description Customize Parameter Editors Enables you to add custom editors for report parameters. Customize Parameter Look Up Source Allows you to customize look-up report parameter values. Customize Parameters, Groups, and Separators
Event Description Customize Parameter Properties Allows you to customize parameters, parameter groups, parameter separators, and property editors. Respond to Server-Side Errors
Event Description On Server Error Occurs on the client each time a server-side error raises. Initialize the Report Designer
Event Description Before Render Occurs before the Report Designer’s UI is initialized.
#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 |
---|---|
Preview |
Occurs when a report document is clicked. |
Customize |
Enables you to customize UI elements. |
Customize |
Allows you to customize toolbar actions. |
Customize |
Allows you to customize export formats and corresponding export options. |
Document |
Occurs after a report has been switched to Print Preview. |
Editing |
Occurs each time an editing field’s value changes. |
Parameters |
Occurs after report parameter values are reset to their default values. |
Parameters |
Occurs after report parameter values are submitted. |