WebDocumentViewerBuilder.Bind(String) Method

Retrieves a report and passes it to the Web Document Viewer.

Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer

Assembly: DevExpress.AspNetCore.Reporting.v20.1.dll

Declaration

public WebDocumentViewerBuilder Bind(
    string reportUrl
)
Public Function Bind(
    reportUrl As String
) As WebDocumentViewerBuilder

Parameters

Name Type Description
reportUrl String

A string that specifies the report to display in the Document Viewer.

Returns

Type Description
WebDocumentViewerBuilder

A WebDocumentViewerBuilder object for use in method chaining.

Remarks

The method is used as illustrated in the following code snippet:

@Html.DevExpress().WebDocumentViewer("DocumentViewer").Height("1000px").Bind("MyReport")

A string specified in this method is processed as follows:

  1. The method checks for the service that implements the ICachedReportSourceWebResolver interface. If the service is available, the method queries the service to get the CachedReportSourceWeb object by the specified report's unique name. If an attempt succeeds, the CachedReportSourceWeb object is passed to the Document Viewer to render and display the report.

  2. If the ICachedReportSourceWebResolver service is not available, the method checks for the IWebDocumentViewerReportResolver service implementation. If the service is available, the method queries the service to get the report instance by the specified report's unique name. If the attempt succeeds, the XtraReport object is passed to the Document Viewer to render and display the report.

  3. If the IWebDocumentViewerReportResolver service is also unavailable, the string is passed to the ReportStorageWebExtension service. The built-in service implementation considers the specified string as the report URL and tries to read the file with that URL (path). If an attempt succeeds, it returns the byte array that contains the report in REPX format. You can register a custom web report storage service that implements a different logic.

TIP

The method with a string parameter allows you to implement a custom logic to cache and reuse reports in order to consume less memory and improve performance.

See Also