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.v24.2.Core.dll
Declaration
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:
DocumentStorageLocation.Document
Stores the elements that are common to the entire document - bookmarks, navigation, page numbers, etc.
-
Stores document pages.
DocumentStorageLocation.ExportInfo
Stores information required to export the document in the continuous (single file) mode. This information is generated if the CachedReportSourceBase.AllowSingleFileExport property is set to true.
DocumentStorageLocation.Metadata
Stores document metadata.
-
Stores document images.
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.