.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.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";

The result is demonstrated in the image below.