The requested page is not available for the requested platform. You are viewing the content for Default platform.

How to: Specify the Default Name for User-Defined Reports

This example demonstrates how to change the default name of user-defined reports in WinForms and ASP.NET applications. Mobile applications do not allow user to create a new report in runtime, so the approach described in this topic cannot be implemented in the Mobile platform.

In this topic, it is assumed that you have an XAF application that uses the Reports V2 Module, and you have created one or more reports (see Reports V2 Module Overview).

In the Module.cs (Module.vb) file, override the ModuleBase.Setup method and handle the static ReportServiceController.QueryRootReportComponentName event to change the default name of user-defined reports. In the event handler, assign the new name to the Name parameter and set the Handled parameter to true.

using DevExpress.ExpressApp.ReportsV2;
// ...
public override void Setup(XafApplication application) {
    ReportServiceController.QueryRootReportComponentName +=
        delegate(object sender, QueryRootReportComponentNameEventArgs e) {
        e.Handled = true;
        e.Name = "MyNewReport";
    };
    base.Setup(application);
}

The result is demonstrated in the image below.

WinForms:

ReportsV2_QueryRootReportComponentName

ASP.NET:

ReportsV2_QueryRootReportComponentName_Web