Skip to main content
.NET 6.0+

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

This example demonstrates how to change the default name of user-defined reports in XAF applications.

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 Web Forms:

ReportsV2_QueryRootReportComponentName_Web