StorageCleanerSettings Class

Provides time settings to clean a storage for storing documents and reports.

Namespace: DevExpress.XtraReports.Web.WebDocumentViewer

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

Declaration

public class StorageCleanerSettings :
    StoragesCleanerSettingsBase
Public Class StorageCleanerSettings
    Inherits StoragesCleanerSettingsBase

Remarks

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.

Settings in a .NET Framework Application

Use the DefaultWebDocumentViewerContainer.Register<T, TImpl> method to register a new instance of the StorageCleanerSettings class with the different time settings.

TIP

The default WebDocumentViewer storage for documents/exported documents/reports is the memory cache. Call the following methods to enable file storage:

Method Description
UseFileDocumentStorage Specifies a path for the report document's file storage.
UseFileExportedDocumentStorage Specifies a path for the exported document's file storage.
UseFileReportStorage Specifies a path for the report's file storage.

The following code demonstrates how to register custom settings in a .NET Framework application. The settings forces a document, report and exported document to live 30 minutes in a client session. The cleaner performs first check 1 minute after start and checks the storage each 5 minutes. After 30 minutes, the document, report and exported document expire and the viewer cannot display them.

using DevExpress.XtraReports.Web.WebDocumentViewer;
//... 
  void Application_Start(object sender, EventArgs e) {
    var dueTime = TimeSpan.FromMinutes(1);
    var period = TimeSpan.FromMinutes(5);
    var reportTimeTolive = TimeSpan.FromMinutes(30);
    var documentTimeToLive = TimeSpan.FromMinutes(30);
    var exportedDocumentTimeToLive = TimeSpan.FromMinutes(30);
    DefaultWebDocumentViewerContainer.RegisterSingleton<StorageCleanerSettings>(new StorageCleanerSettings(dueTime, period, reportTimeTolive, documentTimeToLive, exportedDocumentTimeToLive));
  }
//...

Settings in a .NET Core Application

Use the AddSingleton method to register a new instance of the StorageCleanerSettings class with the different time settings.

TIP

The default WebDocumentViewer storage for documents/exported documents/reports is the memory cache. Call the following methods to enable file storage:

Method Description
UseFileDocumentStorage Specifies a path for the report document's file storage.
UseFileExportedDocumentStorage Specifies a path for the exported document's file storage.
UseFileReportStorage Specifies a path for the report's file storage.

The following code demonstrates how to register custom settings in a .NET Core application.

using DevExpress.AspNetCore;
using DevExpress.AspNetCore.Reporting;
using DevExpress.XtraReports.Web.WebDocumentViewer;
//... 

public class Startup {
//... 
  public void ConfigureServices(IServiceCollection services) {
    services.AddDevExpressControls();
    services.AddMvc(); 

    var dueTime = TimeSpan.FromMinutes(30);
    var period = TimeSpan.FromMinutes(30);
    var reportTimeTolive = TimeSpan.FromMinutes(30);
    var documentTimeToLive = TimeSpan.FromMinutes(30);
    var exportedDocumentTimeToLive = TimeSpan.FromMinutes(30);
    services.AddSingleton<StorageCleanerSettings>(new StorageCleanerSettings(dueTime, period, reportTimeTolive, documentTimeToLive, exportedDocumentTimeToLive));
    });        
  }
//...    
}

Inheritance

Object
DevExpress.XtraReports.Web.WebDocumentViewer.Native.Services.StoragesCleanerSettingsBase
StorageCleanerSettings
See Also