Aspose Cells for Java JSON Export

Hello Team,
I have a query regarding exporting the excel contents to JSON using Workbook.save(jsonfilename) or using
JsonSaveOptions options = new JsonSaveOptions();
Range range = filledWorkbook.getWorksheets().get(0).getCells().createRange(0, 0, lastCell.getRow() + 1, lastCell.getColumn() + 1);
String data = JsonUtility.exportRangeToJson(range, options);

But this yields a result which is not in a structured mannered.
For Example - If we try to export following excel file to json
Form_ABC_1_Filled.zip (13.5 KB)
The output is -
Form_ABC_1_OutJson.zip (927 Bytes)

Where as what we want to extract json object as -
Form_ABC_1_SampleData.zip (616 Bytes)

Is there a way we can achieve this ? Can you provide us with the sample code / snippet to achieve the required json from the Excel?

Regards
Mukul

@mukulpurohit,

Thanks for the sample files.

After an initial testing, I am able to reproduce the issue as you mentioned by using your template file and following sample code. I found the JSON result is not in your desired structured format.
e.g.
Sample code:

Workbook wb = new Workbook("f:\\files\\Form_ABC_1_Filled.xlsx");
Worksheet worksheet = wb.getWorksheets().get(0);
Cell lastCell = worksheet.getCells().getLastCell();
int linhas = worksheet.getCells().getMaxDataRow() +1; //number of lines
int colunas; //number of columns
colunas = worksheet.getCells().getMaxDataColumn() +1;

JsonSaveOptions options = new JsonSaveOptions();
Range range = wb.getWorksheets().get(0).getCells().createRange(0, 0, linhas, colunas);
String data = JsonUtility.exportRangeToJson(range, options);
System.out.println(data);

We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45791

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@mukulpurohit
It’s hard to convert the template to your excepted json struct.
We cannot determine the subordinate structures, which are properties of an object.
We have no plan to support this feature.

Now you can traverse the data (cells.GetEnumerator())and export it into the desired structure.