ReportingConfigurationBuilder.UseAsyncEngine() Method
Allows you to use asynchronous interfaces and methods.
Namespace: DevExpress.AspNetCore.Reporting
Assembly: DevExpress.AspNetCore.Reporting.v22.1.dll
NuGet Package: DevExpress.AspNetCore.Reporting
Declaration
Returns
Type | Description |
---|---|
ReportingConfigurationBuilder | A ReportingConfigurationBuilder that can be used to further configure reporting services. |
Remarks
The UseAsyncEngine method turns on the asynchronous mode that allows the application to access threads from the thread pool while reporting components load, save, or export reports. In asynchronous mode, you should use interfaces and methods with the “Async” postfix instead of their counterparts.
To switch to asynchronous mode, call the UseAsyncEngine method at application startup:
using DevExpress.AspNetCore.Reporting;
using Microsoft.Extensions.DependencyInjection;
public class Startup {
// ...
public void ConfigureServices(IServiceCollection services) {
// ...
services.ConfigureReportingServices(configurator => {
// ...
configurator.UseAsyncEngine();
});
}
// ...
}
If you bind a reporting control to a report model (the WebDocumentViewerModel instance), the reporting engine uses asynchronous API calls. You should generate a report model in the controller and pass the model to the Document Viewer.
If a reporting control is bound to a report instance or a string (report name), the reporting engine does not use asynchronous methods and interfaces.
Note
The complete sample project is available in the following DevExpress Examples repository on GitHub: How to Use the Asynchronous Engine for Web Reporting.
Asynchronous API
The following table lists interfaces and methods with their asynchronous counterparts:
Report Provider
A report provider creates or retrieves a report object based on the report identifier (report URL). When you implement a custom IReportProviderAsync service, use asynchronous methods. Note that in asynchronous mode, blocking requests use the IReportProvider service instead of the IReportProviderAsync service.
Interface | Async Counterpart |
---|---|
IReportProvider | IReportProviderAsync |
Web Report Storage (ReportStorageWebExtension class)
If your application includes a web report storage, and you wish to use the asynchronous engine, implement the async equivalents of the ReportStorageWebExtension methods. Note that in asynchronous mode, blocking requests use methods without the Async postfix.
Method | Async Counterpart |
---|---|
GetData | GetDataAsync |
none | AfterGetDataAsync |
GetUrls | GetUrlsAsync |
SetData | SetDataAsync |
SetNewData | SetNewDataAsync |
Report Model
Use async methods in controller actions to create a report model and pass it to the client.
Report
JSON Web Token Authentication
Interface | Async Counterpart |
---|---|
IWebDocumentViewerExportResultUriGenerator | IWebDocumentViewerExportResultUriGeneratorAsync |