Back to Devexpress

ASPxClientReportDesignerReportSavingDialogEventArgs Class

xtrareports-js-aspxclientreportdesignerreportsavingdialogeventargs.md

latest3.5 KB
Original Source

ASPxClientReportDesignerReportSavingDialogEventArgs Class

Provides data for the ASPxClientReportDesigner.ReportSaving event.

Declaration

ts
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

Cancel

Report

Url

Inheritance

ASPxClientEventArgs ASPxClientReportDesignerDialogEventArgs ASPxClientReportDesignerDialogCancelEventArgs ASPxClientReportDesignerReportSavingDialogEventArgs

constructor(url, report)

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

Declaration

ts
constructor(
    url: string,
    report: any
)

Parameters

NameType
urlstring
reportany

Properties

Dialog Property

Allows you to close the Save Report dialog.

Declaration

ts
Dialog: any

Property Value

TypeDescription
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.

  • Designer.cshtml

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