Skip to main content

ASPxWebDocumentViewer.OpenReport(CachedReportSourceWeb) Method

Opens the report associated with the specified CachedReportSourceWeb object in the ASPxWebDocumentViewer.

Namespace: DevExpress.XtraReports.Web

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

NuGet Package: DevExpress.Web.Reporting

Declaration

public void OpenReport(
    CachedReportSourceWeb cachedReportSource
)

Parameters

Name Type Description
cachedReportSource CachedReportSourceWeb

An object associated with the report to be displayed.

Remarks

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 CachedReportSourceWeb(report);
documentViewer.OpenReport(cachedReportSource); 

Tip

If several OpenReport method calls are invoked, the Document Viewer displays the report that is specified in the latest method call.

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.

Note

The CachedReportSourceWeb component cannot be associated with reports that include a PrintableComponentContainer.

See Also