The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxWebDocumentViewer.OpenReport(String) Method

Opens the specified report in the ASPxWebDocumentViewer.

Namespace: DevExpress.XtraReports.Web

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

Declaration

public void OpenReport(
    string reportUrl
)
Public Sub OpenReport(
    reportUrl As String
)

Parameters

Name Type Description
reportUrl String

A String value specifying a report's unique name.

Remarks

A Document Viewer requests an appropriate CachedReportSourceWeb object to generate a report document by the specified report unique name, when required. The CachedReportSourceWeb object generates a report document caching each generated page. This consumes less memory in comparison to the document generation method used when a report instance is directly passed to the Document Viewer.

using DevExpress.XtraReports.Web    
//... 
...
documentViewer.OpenReport('myReport'); 

Implement the ICachedReportSourceWebResolver interface to associate the specified unique report name with the CachedReportSourceWeb object that possesses the corresponding report. The following code demonstrates how to register a custom ICachedReportSourceWebResolver.

void Application_Start(object sender, EventArgs e) {
    DefaultWebDocumentViewerContainer.Register<ICachedReportSourceWebResolver, CustomCachedReportSourceWebResolver>();
}
Tip

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

Using this OpenReport method overload allows the Document Viewer to regenerate documents when using their [interactive features]Provide Interactivity after the application pool has recycled, because the initial report can always be found.

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.

Note

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

See Also