Back to Devexpress

DefaultWebDocumentViewerContainer.UseCachedReportSourceBuilder() Method

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

latest4.6 KB
Original Source

DefaultWebDocumentViewerContainer.UseCachedReportSourceBuilder() Method

Forces reporting components to use the CachedReportSourceWeb instance as the report source.

Namespace : DevExpress.XtraReports.Web.WebDocumentViewer

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

NuGet Package : DevExpress.Web.Reporting.Common

Declaration

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

Remarks

This method addresses errors that intermittently occur when the Document Viewer and the Report Designer’s Preview operate in a clustered hosting environment. These errors occur when a user request is handled by an application instance that has no access to documents or reports created earlier.

Call this method to force the Document Viewer and the Report Designer’s Preview to use the CachedReportSourceWeb instance as the report source.

csharp
using DevExpress.XtraReports.Web.WebDocumentViewer;
// ...

protected void Application_Start(object sender, System.EventArgs e) {
    // ...
    DefaultWebDocumentViewerContainer.UseCachedReportSourceBuilder();
}
vb
Imports DevExpress.XtraReports.Web.WebDocumentViewer
' ...

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    ' ...
    DefaultWebDocumentViewerContainer.UseCachedReportSourceBuilder()
End Sub

View Example: Reporting for Web (ASP.NET MVC) - Reporting Controls in a Clustered Web Environment (Web Farms or Web Garden)

Review the following help topics for more information:

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UseCachedReportSourceBuilder() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

reporting-web-mvc-viewer-clustering/CS/DevExpressWebFarmsWebGardenReporting/Global.asax.cs#L16

csharp
DefaultWebDocumentViewerContainer.UseFileReportStorage(Server.MapPath("~/CustomSharedViewerStorage/Reports"), StorageSynchronizationMode.InterProcess);
DefaultWebDocumentViewerContainer.UseCachedReportSourceBuilder();
DefaultWebDocumentViewerContainer.Register<ICachedReportSourceWebResolver, CustomCachedReportSourceWebResolver>();

reporting-web-mvc-viewer-clustering/VB/DevExpressWebFarmsWebGardenReporting/Global.asax.vb#L17

vb
DefaultWebDocumentViewerContainer.UseFileReportStorage(Server.MapPath("~/CustomSharedViewerStorage/Reports"), StorageSynchronizationMode.InterProcess)
DefaultWebDocumentViewerContainer.UseCachedReportSourceBuilder()
DefaultWebDocumentViewerContainer.Register(Of ICachedReportSourceWebResolver, CustomCachedReportSourceWebResolver)()

See Also

DefaultWebDocumentViewerContainer Class

DefaultWebDocumentViewerContainer Members

DevExpress.XtraReports.Web.WebDocumentViewer Namespace