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.v20.1.Web.dll

Declaration

public class ReportDesignerClientSideModelGenerator
Public Class ReportDesignerClientSideModelGenerator

Examples

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