Back to Devexpress

DefaultWebDocumentViewerContainer.UseAsyncEngine() Method

xtrareports-devexpress-dot-xtrareports-dot-web-dot-webdocumentviewer-dot-defaultwebdocumentviewercontainer-1da50607.md

latest9.6 KB
Original Source

DefaultWebDocumentViewerContainer.UseAsyncEngine() Method

Allows you to use asynchronous interfaces and methods.

Namespace : DevExpress.XtraReports.Web.WebDocumentViewer

Assembly : DevExpress.XtraReports.v25.2.Web.dll

NuGet Package : DevExpress.Web.Reporting.Common

Declaration

csharp
public static void UseAsyncEngine()
vb
Public Shared Sub UseAsyncEngine

Remarks

The UseAsyncEngine method turns on asynchronous mode for the Web Document Viewer. It allows the application to access threads from the thread pool while reporting components load, save, or export reports.

Important

In asynchronous mode, you should use asynchronous interfaces and methods with the “Async” postfix instead of their counterparts.

Asynchronous mode does not guarantee that all services will call their asynchronous method implementations. If in your application you call the “synchronous” method counterpart, it may cancel asynchronous process execution, and subsequently reporting services start calling their synchronous method implementations.

To switch to asynchronous mode, call the UseAsyncEngine method at application startup:

csharp
DevExpress.XtraReports.Web.WebDocumentViewer.DefaultWebDocumentViewerContainer.UseAsyncEngine();
vb
DevExpress.XtraReports.Web.WebDocumentViewer.DefaultWebDocumentViewerContainer.UseAsyncEngine()

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.

InterfaceAsync Counterpart
IReportProviderIReportProviderAsync

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.

MethodAsync Counterpart
GetDataGetDataAsync
noneAfterGetDataAsync
GetUrlsGetUrlsAsync
SetDataSetDataAsync
SetNewDataSetNewDataAsync

Report Model

Use async methods in controller actions to create a report model and pass it to the client.

MethodAsync Counterpart
WebDocumentViewerClientSideModelGenerator.GetModelWebDocumentViewerClientSideModelGenerator.GetModelAsync
ReportDesignerClientSideModelGenerator.GetModelReportDesignerClientSideModelGenerator.GetModelAsync

Report

MethodAsync Counterpart
CreateDocumentCreateDocumentAsync
ExportToCsvExportToCsvAsync
ExportToDocxExportToDocxAsync
ExportToHtmlExportToHtmlAsync
ExportToImageExportToImageAsync
ExportToMailExportToMailAsync
ExportToMhtExportToMhtAsync
ExportToPdfExportToPdfAsync
ExportToRtfExportToRtfAsync
ExportToTextExportToTextAsync
ExportToXlsExportToXlsAsync
ExportToXlsxExportToXlsxAsync
PrintPrintAsync

JSON Web Token Authentication

InterfaceAsync Counterpart
IWebDocumentViewerExportResultUriGeneratorIWebDocumentViewerExportResultUriGeneratorAsync

Report Wizard Customization Service

MethodAsync Counterpart
CustomizeReportTypeListCustomizeReportTypeListAsync
TryCreateCustomReportTryCreateCustomReportAsync
CustomizeReportOnFinishCustomizeReportOnFinishAsync

See Also

DefaultWebDocumentViewerContainer Class

DefaultWebDocumentViewerContainer Members

DevExpress.XtraReports.Web.WebDocumentViewer Namespace