Skip to main content
A newer version of this page is available. .

ASPxWebDocumentViewer.OpenReport(String) Method

Opens the specified report in the ASPxWebDocumentViewer.

Namespace: DevExpress.XtraReports.Web

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

NuGet Package: DevExpress.Web.Reporting

Declaration

public void OpenReport(
    string reportUrl
)

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.

The following code snippets (auto-collected from DevExpress Examples) contain references to the OpenReport(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also