Skip to main content

StartupExtensions.AddDefaultReportingControllers(IMvcBuilder) Method

OBSOLETE

This method is no longer used. Review the following document for more information: https://go.devexpress.com/Reporting_BC1019255.aspx

The method is obsolete and should not be used in your code.

Namespace: DevExpress.AspNetCore.Reporting

Assembly: DevExpress.AspNetCore.Reporting.v24.1.dll

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

[Obsolete("This method is no longer used. Review the following document for more information: https://go.devexpress.com/Reporting_BC1019255.aspx", true)]
public static IMvcBuilder AddDefaultReportingControllers(
    this IMvcBuilder builder
)

Parameters

Name Type Description
builder IMvcBuilder

The IMvcBuilder instance this method extends.

Returns

Type Description
IMvcBuilder

A IMvcBuilder that can be used to further configure the MVC services.

Remarks

Do not use this method. Instead, implement the reporting controllers explicitly. For more information, review the following document: Breaking Change T1019255.

To implement custom controllers, inherit from the base controller class and specify a custom route.

The following table lists base controller classes that process requests from reporting components, default routes, and methods that allow you to specify custom routes:

Component Base Controller Class Predefined Route Custom Route
Report Designer ReportDesignerController DXXRD ReportDesignerHandlerUri(String)
Document Viewer WebDocumentViewerController DXXRDV ReportPreviewHandlerUri(String)
Query Builder QueryBuilderController DXXQB QueryBuilderHandlerUri(String)

An application with End-User Report Designer requires all three controllers for proper operation.

The following code snippet implements controllers with default routes:

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) {
    }
}

For more code samples with custom controllers, review the following example:

View Example: ASP.NET Core Reporting - Best Practices

See Also