When exporting a GridJsWorkbook to JSON, we’re seeing that cols
for each sheet is always at least 16, even when the source excel file has fewer columns. Similarly, when converting an Excel file with a single row, the output from ExportToJson says that rows len is 13.
{
"actname": "Sheet1",
"actrow": 0,
"actcol": 0,
"showtabs": true,
"uniqueid": "d0cdcd17763c5c1eb763e7746a629fc8f6f13c88d71647421fddd31e3af01378",
"filename": "book1",
"data": [
{
"name": "Sheet1",
"sheetid": "s0",
"showGrid": true,
"sprotected": false,
"canselectlocked": true,
"displayRight2Left": false,
"canselectunlocked": true,
"styles": [
{
"textwrap": false,
"color": "#000000",
"valign": "bottom",
"font": {
"name": "Calibri",
"size": 12,
"bold": false,
"italic": false
}
}
],
"cols": {
"len": 16,
"0": {
"width": 90
},
"1": {
"width": 90
},
"2": {
"width": 90
},
"3": {
"width": 90
},
"4": {
"width": 90
},
"5": {
"width": 90
},
"6": {
"width": 90
},
"7": {
"width": 90
},
"8": {
"width": 90
},
"9": {
"width": 90
},
"10": {
"width": 90
},
"11": {
"width": 90
},
"12": {
"width": 90
},
"13": {
"width": 90
},
"14": {
"width": 90
},
"15": {
"width": 90
}
},
"rows": {
"len": 13,
"height": 21,
"0": {
"cells": {
"0": {
"text": "Hello",
"style": 0
}
}
}
},
"rowinfo": {
"0": {
"h": 21
}
}
}
]
}
Is there a way to tell the GridJs export code to not add in empty columns/cells? I.e. if there’s only one column/row in the worksheet, then the output should be:
{
"actname": "Sheet1",
"actrow": 0,
"actcol": 0,
"showtabs": true,
"uniqueid": "d0cdcd17763c5c1eb763e7746a629fc8f6f13c88d71647421fddd31e3af01378",
"filename": "book1",
"data": [
{
"name": "Sheet1",
"sheetid": "s0",
"showGrid": true,
"sprotected": false,
"canselectlocked": true,
"displayRight2Left": false,
"canselectunlocked": true,
"styles": [
{
"textwrap": false,
"color": "#000000",
"valign": "bottom",
"font": {
"name": "Calibri",
"size": 12,
"bold": false,
"italic": false
}
}
],
"cols": {
"len": 1,
"0": {
"width": 90
}
},
"rows": {
"len": 1,
"height": 21,
"0": {
"cells": {
"0": {
"text": "Hello",
"style": 0
}
}
}
},
"rowinfo": {
"0": {
"h": 21
}
}
}
]
}