Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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