DefaultWebDocumentViewerContainer.UseFileExportedDocumentStorage(String, StorageSynchronizationMode) Method

Specifies a path and synchronization mode for the exported document's file storage.

Namespace: DevExpress.XtraReports.Web.WebDocumentViewer

Assembly: DevExpress.XtraReports.v18.1.Web.dll

Declaration

public static void UseFileExportedDocumentStorage(
    string workingDirectory,
    StorageSynchronizationMode storageSynchronizationMode
)
Public Shared Sub UseFileExportedDocumentStorage(
    workingDirectory As String,
    storageSynchronizationMode As StorageSynchronizationMode
)

Parameters

Type Name Description
String workingDirectory

Specifies a path to the directory where exported documents should be stored.

StorageSynchronizationMode storageSynchronizationMode

Specifies a synchronization mode for the file storage.

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

By default, the exported document is stored in a memory cache and removed from it the first time it is requested. You can make the Document Viewer use a file storage instead. For this purpose, use the UseFileExportedDocumentStorage method.

Use the UseFileExportedDocumentStorage(String, StorageSynchronizationMode) method overload to specify the InterProcess synchronization mode if you use Web Farms or Garden. By default, the InterThread mode is set.

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

using DevExpress.XtraReports.Web.WebDocumentViewer;
//... 
  DefaultWebDocumentViewerContainer.UseFileExportedDocumentStorage(Server.MapPath("~/App_Data/PreviewCache"), StorageSynchronizationMode.InterProcess);
//...

According to the time settings specified in the CacheCleanerSettings and StorageCleanerSettings classes, the default cleaner service periodically checks if the cache and file storage contain exported documents whose lifetime exceeds a specific amount of time. If such documents are found, they are deleted. Call the UseEmptyStoragesCleaner() method to register an empty storage cleaner instead of the default one, so that documents are not removed automatically.

See Also