public void OpenReport( CachedReportSourceWeb cachedReportSource )
Public Sub OpenReport( cachedReportSource As CachedReportSourceWeb )
An object associated with the report to be displayed.
The CachedReportSourceWeb object passed as the method parameter generates a document for the associated report, caching each generated page. This consumes less memory in comparison to the document generation method used when a report instance is bound directly to the Document Viewer.
using DevExpress.XtraPrinting.Caching; //... var report = new XtraReport1(); var cachedReportSource = new CachedReportSource(report); documentViewer.OpenReport(cachedReportSource);
If several OpenReport method calls are invoked, the Document Viewer displays the report that is specified in the latest method call.
By default, a CachedReportSourceWeb object caches a report document to the MemoryDocumentStorage. You can use a file, database or a custom storage instead so that the Document Viewer can recover its document from the storage after the application pool has recycled. Utilize a file storage by calling the UseFileDocumentStorage (.NET Framework) / UseFileDocumentStorage (.NET Core) method. To use a database or a custom storage, register your IDocumentStorageProvider object.
If the CachedReportSourceWeb object's report includes interactive features, they are available to end users only until the application pool is recycled. Using interactive features demands document regeneration. But after the application pool is recycled, the document cannot be regenerated, because the initial report is not accessible. To avoid these issues, use the OpenReport(String) method overload instead.
The CachedReportSourceWeb component cannot be associated with reports that include a PrintableComponentContainer.