Json Rows Result Set is not correct using GC document

Posted by: pooja.bansal on 25 February 2021, 6:14 am EST

  • Posted 25 February 2021, 6:14 am EST

    Hi,

    In our application, previously we were using Farpoint Excel.IO to convert Spread.Net instance to Spread Js instance. Now, we have replaced Farpoint with gc documents for Spread JS 13/14.

    When we were using Farpoint Excel.IO-

    For the hidden rows, the size of the row is set to 0 (By default it was 17).

    Now, with the gc document implementation, it sets the property visible false, and don’t set the size of the row.

    Please refer below code for the gc document implementation -

    inpRptBaseManager - IForm

    inpRptBaseManager.Spread.SaveExcel(stream, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);

    stream.Position = 0;

    var workbook = new GrapeCity.Documents.Excel.Workbook(GCDocumentsLicenseKey);

    workbook.Open(stream);

    var json = workbook.ToJson();

    Json Result for rows with ExcelIO for Rows -

    “rows”: [

    {​​​​​​

    “size”: 60

    }​​​​​​,

    {​​​​​​

    “size”: 41

    }​​​​​​,

    {​​​​​​

    “size”: 54

    }​​​​​​,

    {​​​​​​

    “size”: 17

    }​​​​​​,

    {​​​​​​

    “size”: 17

    }​​​​​​,

    {​​​​​​

    “size”: 17

    }​​​​​​,

    {​​​​​​

    “size”: 17

    }​​​​​​,

    {​​​​​​

    “size”: 17

    }​​​​​​,

    {​​​​​​

    “size”: 17

    }​​​​​​,

    {​​​​​​

    “size”: 17

    }​​​​​​,

    {​​​​​​

    “size”: 0

    }​​​​​​,

    {​​​​​​

    “size”: 0

    }​​​​​​,

    {​​​​​​

    “size”: 17

    }​​​​​​

    ]

    JSON Result for rows with gc document -

    “rows”: [

    {

    “size”: 60

    },

    {

    “size”: 41

    },

    {

    “size”: 54

    },

    {},

    {},

    {},

    {},

    {},

    {},

    {},

    {

    “visible”: false

    },

    {

    “visible”: false

    },

    {}

    ],

    How can we get the same result using gc document as we were getting using ExcelIO?

  • Posted 26 February 2021, 8:59 am EST

    Hi Pooja,

    Spread.Net and Grapectiy Excel is a different product and its working is also different. You are creating the JSON to load in the SpreadJS. Since the Spread and Gc Excel working is different, the exported JSON would also be different.

    You are going to load the exported JSON in the Spread JS. Since the exported JSON would be loaded correctly in the Spread JS.

    Please let us know if you are facing any issues in loading the JSON in SpreadJS. Or you are doing any process on exported JSON.

    Regards,

    Manish Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels