Skip to main content

CacheReportDocumentEventArgs.SaveDocumentToMemoryStream() Method

Saves the current document to a memory stream.

Namespace: DevExpress.XtraReports.Web

Assembly: DevExpress.XtraReports.v24.1.Web.WebForms.dll

NuGet Package: DevExpress.Web.Reporting

Declaration

public MemoryStream SaveDocumentToMemoryStream()

Returns

Type Description
MemoryStream

A MemoryStream object, which contains the saved document as a byte array.

Remarks

The SaveDocumentToMemoryStream method is intended to implement caching a web report.

To accomplish this task, you need to handle the ReportViewer.CacheReportDocument event, and if a report document is already generated, save it to a memory stream via the SaveDocumentToMemoryStream method. Then, you need to handle the ReportViewer.RestoreReportDocumentFromCache event, and if the document is already stored in cache, restore it via the RestoreReportDocumentFromCacheEventArgs.RestoreDocumentFromStream method.

See Also