Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IDocumentStorageProvider Interface

In This Article

When implemented by a class, manages document storages.

Namespace: DevExpress.XtraReports.Web.WebDocumentViewer

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

NuGet Package: DevExpress.Web.Reporting.Common

#Declaration

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:

void Application_Start(object sender, EventArgs e) {
    DefaultWebDocumentViewerContainer.Register<IDocumentStorageProvider, CustomDocumentStorageProvider>();
}

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

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