Skip to main content
All docs
V24.1

WebDocumentViewerBuilderBase<TSettings, TImpl, TModel>.Bind(String) Method

Retrieves a report and passes it to the reporting component.

Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer

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

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

public virtual TImpl Bind(
    string reportUrl
)

Parameters

Name Type Description
reportUrl String

A string that specifies the report to show in the reporting component.

Returns

Type Description
TImpl

A WebDocumentViewerBuilderBase<TSettings, TImpl, TModel> that can be used in method chaining to configure the component.

Remarks

The Bind(string reportUrl)method allows you to implement a custom logic to cache and reuse reports in order to consume less memory and improve performance.

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 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.

  2. If the IWebDocumentViewerReportResolver service is unavailable, the string is passed to the IReportProvider service. If the service is available, the method queries the service to get the report instance by the specified report’s unique name.

  3. If the IReportProvider service is unavailable, the string is passed to the ReportStorageWebExtension service.

One of the above services must be explicitly implemented and registered. Otherwise, the Bind(System.String) method fails with an exception.

Tip

The recommended services are the IReportProvider for Document Viewer and Parameters Panel, or the ReportStorageWebExtension service for the Report Designer component.

See Also