ReportDesignerClientSideModelGenerator.CreateErrorJson(Exception) Method

Creates the JSON string with the error that can occur when generating a client-side Report Designer model.

Namespace: DevExpress.XtraReports.Web.ReportDesigner

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


public string CreateErrorJson(
    Exception exception
Public Function CreateErrorJson(
    exception As Exception
) As String


Name Type Description
exception Exception

A Exception object that specifies the exception based on which the JSON string should be created.


Type Description

A string with the error information serialized to the JSON format.


The following code demonstrates how to use this method to return the error if an exception occurs when using the GetJsonModelScript method.

public ActionResult GetReportDesignerModel(string reportUrl) {
    try {
        string modelJsonScript = new ReportDesignerClientSideModelGenerator().GetJsonModelScript(...);
        return Content(modelJsonScript, "application/json");
    catch(Exception exception) {
        string errorJson = new ReportDesignerClientSideModelGenerator().CreateErrorJson(exception);
        return Content(errorJson, "application/json");
See Also