Skip to main content

ICachedReportSourceWebResolver Interface

Retrieves a CachedReportSourceWeb object associated with the specified report name.

Namespace: DevExpress.XtraReports.Web.WebDocumentViewer

Assembly: DevExpress.XtraReports.v22.1.Web.dll


public interface ICachedReportSourceWebResolver


When the Web Document Viewer displays a report specified by its name, it can use a ICachedReportSourceWebResolver service to get the CachedReportSourceWeb object that generates a document from a report and caches the document pages.


The following code is a custom ICachedReportSourceWebResolver implementation:

public class CustomCachedReportSourceWebResolver : ICachedReportSourceWebResolver {
  public bool TryGetCachedReportSourceWeb(string reportName, out CachedReportSourceWeb CachedReportSourceWeb) {
      XtraReport report = null;
      if(reportName == "Report1") {
          report = new Report1();
      if(reportName == "Report2") {
          report = new Report2();
      if(reportName == "DocumentMerging") {
          var report1 = new Report1();
          var cachedReportSource1 = new CachedReportSourceWeb(report1);

          var report2 = new Report2();
          var cachedReportSource2 = new CachedReportSourceWeb(report2);

          cachedReportSource1.ModifyDocument(x => {
          CachedReportSourceWeb = cachedReportSource1;
          return true;
      if(report == null) {
          CachedReportSourceWeb = null;
          return false;
      CachedReportSourceWeb = new CachedReportSourceWeb(report);
      return true;


  • ASP.NET Web Forms and MVC applications

    using DevExpress.XtraReports.Web.WebDocumentViewer;
    void Application_Start(object sender, EventArgs e) {
        DefaultWebDocumentViewerContainer.Register<ICachedReportSourceWebResolver, CustomCachedReportSourceWebResolver>();
  • ASP.NET Core applications

    using DevExpress.XtraReports.Web.WebDocumentViewer;
    public void ConfigureServices(IServiceCollection services) {
        services.AddSingleton<ICachedReportSourceWebResolver>(new CustomCachedReportSourceWebResolver());

If the TryGetCachedReportSourceWeb(String, out CachedReportSourceWeb) method returns false, the Document Viewer calls the IWebDocumentViewerReportResolver service.


Review the Open a Report in ASP.NET Core Application help topic for more information.

See Also