Back to Devexpress

IDocumentStorageProvider Interface

xtrareports-devexpress-dot-xtrareports-dot-web-dot-webdocumentviewer-009440e9.md

latest2.9 KB
Original Source

IDocumentStorageProvider Interface

When implemented by a class, manages document storages.

Namespace : DevExpress.XtraReports.Web.WebDocumentViewer

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

NuGet Package : DevExpress.Web.Reporting.Common

Declaration

csharp
public interface IDocumentStorageProvider
vb
Public Interface IDocumentStorageProvider

Remarks

When a CachedReportSourceWeb object generates a report document, it caches each generated page in a storage. By default, a MemoryDocumentStorage storage is created for every document. Implement this interface to create another type storage (e.g. DbDocumentStorage or a custom one).

The following code demonstrates how to register a custom document storage provider in a .NET Framework application:

csharp
void Application_Start(object sender, EventArgs e) {
    DefaultWebDocumentViewerContainer.Register<IDocumentStorageProvider, CustomDocumentStorageProvider>();
}
vb
Private Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    DefaultWebDocumentViewerContainer.Register(Of IDocumentStorageProvider, CustomDocumentStorageProvider)()
End Sub

The following code demonstrates how to register your IDocumentStorageProvider in an ASP.NET Core application.

csharp
using DevExpress.XtraReports.Web.WebDocumentViewer;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddSingleton<IDocumentStorageProvider>(new CustomDocumentStorageProvider());

var app = builder.Build();

You can utilize a predefined file document storage by calling the UseFileDocumentStorage (.NET Framework) / UseFileDocumentStorage (.NET Core) method.

See Also

IDocumentStorageProvider Members

DevExpress.XtraReports.Web.WebDocumentViewer Namespace