Skip to main content
A newer version of this page is available. .

IReportJsonSerializer Interface

A service that serializes a report to JSON and deserializes JSON to report.

Namespace: DevExpress.XtraReports.Web.ReportDesigner.Services

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


public interface IReportJsonSerializer


The following code uses the ASPxClientReportDesigner.GetJsonReportModel method to serialize the report loaded in the Report Designer and sends the JSON string to the controller. The controller deserializes the report with the IReportJsonSerializer.DeserializeFromJson(String) method and calls the XtraReport.SaveLayoutToXml(Stream) method to save the report in XML format.

<script type="text/javascript">
    function OnBeforeRender(s, e) {
        window['reportDesigner'] = s;
    function OnSaveButtonClick() {
        var reportTab = reportDesigner.GetCurrentTab();
        var reportLayout = reportDesigner.GetJsonReportModel();
        var reportUrl = reportTab.url();
        $.post("/Home/SetReport", { layout: JSON.stringify({ "XtraReportsLayoutSerializer": reportLayout }), url: reportUrl });
<button onclick="OnSaveButtonClick()">Click To Save</button>

    var designer = Html.DevExpress().ReportDesigner("reportDesigner1")
        .ClientSideEvents(configure => configure.BeforeRender("OnBeforeRender"));
See Also