ASPxClientReportDesigner.ReportOpening Event
Occurs when a report is about to be opened in the Web Report Designer.
Namespace: DevExpress.XtraReports.Web.Scripts
Assembly: DevExpress.XtraReports.v18.2.Web.Scripts.dll
Declaration
Event Data
The ReportOpening event's data class is ASPxClientReportDesignerDialogCancelEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Cancel | Specifies whether or not the operation performed with a report should be canceled. |
Report | Specifies the report currently being processed. Inherited from ASPxClientReportDesignerDialogEventArgs. |
Url | Specifies the URL of the report currently being processed. Inherited from ASPxClientReportDesignerDialogEventArgs. |
Remarks
Handle the ReportOpening event to perform required actions before a report is opened in the Web Report Designer.
This event fires in the following cases:
- when you run the Report Designer with a specific report assigned;
- when you open a report using the Open menu command and Open Report dialog;
- when you open a report using the client-side ASPxClientReportDesigner.OpenReport method.
To prevent the report from being opened, set the ASPxClientReportDesignerDialogCancelEventArgs.Cancel property of an event argument to true.
The following example demonstrates how to use this event to prohibit opening reports with URLs containing a specific substring.
<script type="text/javascript" id="script">
function reportOpening(s, e) {
if (e.Url.toLowerCase().includes("table"))
e.Cancel = true;
}
</script>
<dx:ASPxReportDesigner ID="ASPxReportDesigner1" runat="server" ClientInstanceName="reportDesigner">
<ClientSideEvents ReportOpening="reportOpening" />
</dx:ASPxReportDesigner>
To customize the report after it has been opened, handle the ASPxClientReportDesigner.ReportOpened event.