Breaking Change T1019255
Visible to All Users

Reporting for ASP.NET Core & Blazor Server - The Report Designer, Web Document Viewer and Query Builder controller classes became abstract

What Changed

ASP.NET Core

  1. The ReportDesignerController, WebDocumentViewerController and QueryBuilderController classes became abstract.
  2. The StartupExtensions.AddDefaultReportingControllers and StartupExtensions.RemoveDefaultReportingControllers methods became obsolete.

Blazor (Server)

  1. The DownloadExportResultController class became obsolete.
  2. We have implemented the DownloadExportResultControllerBase abstract base class.
  3. The StartupExtensions AddDevExpressServerSideBlazorReportViewerControllers and RemoveDevExpressServerSideBlazorReportViewerControllers methods became obsolete.

Reasons for Change

We made controller classes abstract to reduce possible security issues.

Impact on Existing Apps

The Report Designer, Document Viewer (Report Viewer in Native Blazor), and Query Builder controls will not work properly without the controller classes, explicitly implemented by the application developer.

When the ASP.NET Core application that references the DevExpress.AspNetCore.Reporting package starts, it searches for the WebDocumentViewerController descendant. If the search fails, an exception is thrown with a message that contains a link to this article.

Affected Apps

  • This breaking change will affect your ASP.NET Core application, if you use ReportDesigner, WebDocumentViewer, or QueryBuilder controls, and have not explicitly declared the corresponding controller classes.
  • This breaking change will affect your Blazor (Server) application, if you use ReportDesigner or ReportViewer controls, and have not explicitly declared the corresponding controller classes.

How to Update Existing Apps

Do the following:

1. Remove obsolete methods

Remove calls to the following obsolete methods:

2. Implement controller classes

Explicitly declare controllers that descend from the built-in base classes. To implement controller classes, create the ReportControllers.cs file with the following content:

ASP.NET Core and Blazor (Server) with JS-Based reporting controls

C#
using DevExpress.AspNetCore.Reporting.QueryBuilder; using DevExpress.AspNetCore.Reporting.QueryBuilder.Native.Services; using DevExpress.AspNetCore.Reporting.ReportDesigner; using DevExpress.AspNetCore.Reporting.ReportDesigner.Native.Services; using DevExpress.AspNetCore.Reporting.WebDocumentViewer; using DevExpress.AspNetCore.Reporting.WebDocumentViewer.Native.Services; // ... public class CustomWebDocumentViewerController : WebDocumentViewerController { public CustomWebDocumentViewerController(IWebDocumentViewerMvcControllerService controllerService) : base(controllerService) { } } public class CustomReportDesignerController : ReportDesignerController { public CustomReportDesignerController(IReportDesignerMvcControllerService controllerService) : base(controllerService) { } } public class CustomQueryBuilderController : QueryBuilderController { public CustomQueryBuilderController(IQueryBuilderMvcControllerService controllerService) : base(controllerService) { } }

Blazor (Server) - Native Report Viewer Control

C#
using DevExpress.Blazor.Reporting.Controllers; using DevExpress.Blazor.Reporting.Internal.Services; // ... public class DownloadExportResultController : DownloadExportResultControllerBase { public DownloadExportResultController(ExportResultStorage exportResultStorage) : base(exportResultStorage) { } }

You can find the files with the required controllers in the attachment. Add the appropriate file to your project.

How to Hide an Exception in ASP.NET Core App

In the ASP.NET Core Reporting application, you can prevent an exception from being thrown if, for some reason, your application can operate without the WebDocumentViewerController descendant. Note that hiding the exception does not solve the problem. You should follow the recommended steps described earlier in the How to Update Existing Apps section, or turn off controller diagnostics and implement your own solution. The following code disables controller diagnostics:

C#
public void ConfigureServices(IServiceCollection services) { // ... services.ConfigureReportingServices(configurator => { configurator.DisableCheckForCustomControllers(); // ... }); // ... }

How to Revert to the Previous Behavior

You cannot revert to the previous behavior.

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.