Skip to main content
A newer version of this page is available. .

DocumentStorage Class

A base class for storages used by the CachedReportSource and CachedReportSourceWeb objects to cache the document that they generate to display/export/print a report.

Namespace: DevExpress.XtraPrinting.Caching

Assembly: DevExpress.Printing.v19.2.Core.dll

Declaration

public abstract class DocumentStorage :
    IDisposable

The following members return DocumentStorage objects:

Library Related API Members
Cross-Platform Class Library CachedReportSourceBase.Storage
Reporting IDocumentStorageProvider.CreateNew(String)

Remarks

You can use one of the following ready-to-use document storages:

In any document storage type, different document parts are stored in different locations. A location is specified by the DocumentStorageLocation enumeration. Here are the possible locations:

Use the DocumentStorage class as a base class to implement a custom document storage. In your descendant, override the following members:

  • Count(DocumentStorageLocation location) method

    Returns an integer value that specifies the record count in the location passed as a parameter.

  • Restore(DocumentStorageLocation location, int id) method

    Restores data stored in the specified storage location under the specified identifier (e.g., a specific document page stored in the Page location under the 3 identifier).

    Returns a System.IO.Stream object containing the requested data.

  • Store(DocumentStorageLocation table, int id, Stream stream) method

    Stores a specified System.IO.Stream object to the specified storage location under the specified identifier.

  • Clear() method

    Clears the storage removing all the document parts.

  • LastAccessTimeUtc property and UpdateLastAccessTime() method

    LastAccessTimeUtc is a read-only property that specifies the time when the document was accessed last. The first time is when the document is generated. Then, each time the document is requested the UpdateLastAccessTime() method must update the LastAccessTimeUtc property value. A document that is not requested within a certain time is removed from the storage.

A document storage is used in a multi-threaded mode. So, the custom document storage must be implemented using a thread safety concept.

See Also