ReportDesignerClientSideModelGenerator.GetJsonModelScript(ReportDesignerModel) Method

Generates a client-side Report Designer model based on the specified data and serializes this model to Json.

Namespace: DevExpress.XtraReports.Web.ReportDesigner

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


public string GetJsonModelScript(
    ReportDesignerModel reportDesignerModel
Public Function GetJsonModelScript(
    reportDesignerModel As ReportDesignerModel
) As String


Name Type Description
reportDesignerModel ReportDesignerModel

A client-side Report Designer model.


Type Description

A string that is a serialized Report Designer model.


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

The GetModel method obtains a client-side model and sets the ASPxReportDesigner.AllowMDI property to false. The GetJsonModelScript method serializes the model to JSON. The model is subsequently sent to the client.

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", "*");

      var generator = new ReportDesignerClientSideModelGenerator();
      var model = generator.GetModel(
              // A report that the Report Designer loads when the application starts.
              // Data sources available in the Report Designer.
              // Controller action that processes Report Designer requests.
              // Controller action that processes Web Document Viewer requests.
              // Controller action that processes Query Builder requests.
      model.AllowMDI = false;
      var modelJsonScript = generator.GetJsonModelScript(model);    
      return Content(modelJsonScript, "application/json");
See Also