Add Reports V2 Module to an Existing XAF Application
- 2 minutes to read
To add the Reports V2 module to an existing XAF application, install the appropriate NuGet package:
Platform | Module | NuGet package |
---|---|---|
platform-agnostic | ReportsModuleV2 | DevExpress.ExpressApp.ReportsV2 |
ASP.NET Core Blazor | DevExpress.ExpressApp.ReportsV2.Blazor.ReportsBlazorModuleV2 |
DevExpress.ExpressApp.ReportsV2.Blazor |
WinForms | ReportsWindowsFormsModuleV2 | DevExpress.ExpressApp.ReportsV2.Win |
ASP.NET Web Forms | ReportsAspNetModuleV2 | DevExpress.ExpressApp.ReportsV2.Web |
Next, use either of the following techniques:
In .NET applications, you can call the AddReports(IModuleBuilder<IBlazorApplicationBuilder>, Action<ReportsOptions>) / AddReports(IModuleBuilder<IWinApplicationBuilder>, Action<ReportsOptions>) method in your ASP.NET Core Blazor / WinForms application builder.
- If you do not use an application builder, you can add these Modules to the ModuleBase.RequiredModuleTypes collection of the platform-specific Module.
- In .NET Framework applications, you can also use the Module Designer and Application Designer to add a module to your project.
The following additional steps may be required:
Entity Framework Core-Based Application
Navigate to the MySolution.Module\BusinessObjects\MySolutionDbContext.cs file and include the ReportDataV2 entity in the data model:
using DevExpress.Persistent.BaseImpl.EF; // ... public class MySolutionEFCoreDbContext : DbContext { // ... public DbSet<ReportDataV2> ReportData { get; set; } // ... }
Navigate to the MySolution.Blazor.Server\Startup.cs file (ASP.NET Core Blazor) or the MySolution.Win\Startup.cs file (Windows Forms) and specify the
ReportDataType
explicitly:// ... builder.Modules .AddReports(options => { options.EnableInplaceReports = true; options.ReportDataType = typeof(DevExpress.Persistent.BaseImpl.EF.ReportDataV2); options.ReportStoreMode = DevExpress.ExpressApp.ReportsV2.ReportStoreModes.XML; })
ASP.NET Core Blazor Application Without Application Builder
Navigate to the MySolution.Blazor.Server\Startup.cs file and call
AddXafReporting
in theStartup.ConfigureServices
method to register the Reports V2 Module services in IServiceCollection:using DevExpress.ExpressApp.ReportsV2.Blazor; // ... public class Startup { // ... public void ConfigureServices(IServiceCollection services){ //... services.AddXafReporting(); } // ... }