xtrareports-js-aspxclientreportdesignerreportsavingdialogeventargs.md
Provides data for the ASPxClientReportDesigner.ReportSaving event.
declare class ASPxClientReportDesignerReportSavingDialogEventArgs extends ASPxClientReportDesignerDialogCancelEventArgs
When the user executes the Save as… command, the Save Report dialog is invoked and the ASPxClientReportDesigner.ReportSaving event is raised. The ASPxClientReportDesignerReportSavingDialogEventArgs class provides data for this event.
ASPxClientEventArgs ASPxClientReportDesignerDialogEventArgs ASPxClientReportDesignerDialogCancelEventArgs ASPxClientReportDesignerReportSavingDialogEventArgs
Initializes a new instance of the ASPxClientReportDesignerReportSavingDialogEventArgs class with specified settings.
constructor(
url: string,
report: any
)
| Name | Type |
|---|---|
| url | string |
| report | any |
Allows you to close the Save Report dialog.
Dialog: any
| Type | Description |
|---|---|
| any |
An object that represents the Save Report dialog. The property is undefined if the Save… command is executed and the dialog is not invoked.
|
Handle the ASPxClientReportDesigner.ReportSaving client-side event and set the Dialog property to false to close the Save Report dialog.
The following example demonstrates how to not save reports with names that meet certain criteria.
When the user executes the Save as… command, the Save Report dialog is invoked. The user enters the report’s name and clicks the Save button. The actions are as follows:
if a report name contains 3 symbols or less, the report is not saved and the dialog remains open;
if a report name contains ‘table’, the report is not saved and the dialog closes.
<script type="text/javascript" id="script">
function onReportSaving(s, e) {
if (e.Url.toLowerCase().includes("table")) {
e.Cancel = true;
if (e.Dialog)
e.Dialog.visible(false);
}
if (e.Url.length <= 3)
e.Cancel = true;
}
</script>
@Html.DevExpress().ReportDesigner(settings => {
settings.Name = "ReportDesigner1";
settings.ClientSideEvents.ReportSaving = "onReportSaving";
}).BindToUrl("TestReport").GetHtml()