Skip to main content

WebDocumentViewerConfigurationBuilder.UseFileExportedDocumentStorage(String) Method

Enables exported document file storage and specifies a storage path.

Namespace: DevExpress.AspNetCore.Reporting

Assembly: DevExpress.AspNetCore.Reporting.v24.1.dll

NuGet Package: DevExpress.AspNetCore.Reporting


public WebDocumentViewerConfigurationBuilder UseFileExportedDocumentStorage(
    string workingDirectory


Name Type Description
workingDirectory String

Specifies a path to store the exported documents.


Type Description

A WebDocumentViewerConfigurationBuilder that can be used to adjust the Web Document Viewer services.


The Document Viewer uses a memory cache or file storage for the exported document in the following cases:

The exported document is stored in a memory cache and removed from it the first time it is requested. To force the Document Viewer to use a file storage, call the UseFileExportedDocumentStorage method.

The following code demonstrates how to use the UseFileExportedDocumentStorage method to specify a file storage for the Document Viewer.

using DevExpress.AspNetCore;
using DevExpress.AspNetCore.Reporting;

var builder = WebApplication.CreateBuilder(args);


builder.Services.ConfigureReportingServices(configurator => {
    configurator.ConfigureWebDocumentViewer(viewerConfigurator => {
        viewerConfigurator.UseFileExportedDocumentStorage(System.IO.Path.Combine(builder.Environment.ContentRootPath, "ExportedDocumentStorage" ));

var app = builder.Build();


If you use Web Farms or Garden, switch to the InterProcess synchronization mode (the default mode is InterThread). For this, call the WebDocumentViewerConfigurationBuilder.UseFileExportedDocumentStorage method with the StorageSynchronizationMode.InterProcess parameter.

The cleaner service periodically searches the cache and file storage for expired documents/exported documents/reports and deletes them. You can use the CacheCleanerSettings and StorageCleanerSettings to specify check interval and expiration time settings. To prevent expired documents from being deleted, call the UseEmptyStoragesCleaner() method to register an empty storage cleaner.

See Also