ASPxClientReportDesignerReportSavingDialogEventArgs Class

Provides data for the ASPxClientReportDesigner.ReportSaving event.

Declaration

declare class ASPxClientReportDesignerReportSavingDialogEventArgs extends ASPxClientReportDesignerDialogCancelEventArgs

Remarks

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.

Inherited Members

constructor(url, report)

Initializes a new instance of the ASPxClientReportDesignerReportSavingDialogEventArgs class with specified settings.

Declaration

constructor(url: string, report: any)

Parameters

Name Type
url string
report any

Properties

Dialog Property

Allows you to close the Save Report dialog.

Declaration

Dialog: any

Property Value

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.

Remarks

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()