Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ReportDesignerClientSideModelGenerator Class

The class used to generate a client-side model of the Web End-User Report Designer.

Namespace: DevExpress.XtraReports.Web.ReportDesigner

Assembly: DevExpress.XtraReports.v24.2.Web.dll

NuGet Package: DevExpress.Web.Reporting.Common

#Declaration

public class ReportDesignerClientSideModelGenerator :
    IReportDesignerClientSideModelGenerator

#Example

The following code implements the controller action and returns the Report Designer model. For more information on Report Designer server-side configuration, refer to the following help topic: Report Designer Server-Side Configuration (ASP.NET MVC).

Note

The complete sample project How to Perform the JavaScript Report Designer Integration (with npm or Yarn package managers) is available in the DevExpress Examples repository.

using DevExpress.Web.Mvc.Controllers;
using DevExpress.XtraReports.Web.ReportDesigner;
using System.Web.Mvc;
// ...
  public ActionResult GetReportDesignerModel(string reportUrl)
  {
      Response.AppendHeader("Access-Control-Allow-Origin", "*");

      string modelJsonScript =
          new ReportDesignerClientSideModelGenerator()
          .GetJsonModelScript(
              reportUrl,
              // A report that the Report Designer loads when the application starts.
              GetAvailableDataSources(),
              // Data sources available in the Report Designer.
              "ReportDesigner/Invoke",
              // Controller action that processes Report Designer requests.
              "WebDocumentViewer/Invoke",
              // Controller action that processes Web Document Viewer requests.
              "QueryBuilder/Invoke"      
              // Controller action that processes Query Builder requests.
          );
      return Content(modelJsonScript, "application/json");
  }

#Inheritance

Object
ReportDesignerClientSideModelGenerator
See Also