WebDocumentViewerBuilder.Bind(String) Method
Retrieves a report and passes it to the Web Document Viewer.
Namespace: DevExpress.AspNetCore.Reporting.WebDocumentViewer
Assembly: DevExpress.AspNetCore.Reporting.v24.2.dll
NuGet Package: DevExpress.AspNetCore.Reporting
Declaration
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:
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.
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.
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 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.