The excel header is not hidden

I can’t hide the header in the resulting excel.
Can you help me?

using (MemoryStream ms = new MemoryStream()) {                
            LoadOptions loadOptions = new LoadOptions(LoadFormat.Xlsx);                
            Workbook workbook = new Workbook(routeTemplate, loadOptions);
            Worksheet sheet = workbook.Worksheets[0];                               
            JsonLayoutOptions options = new JsonLayoutOptions();
            **options.IgnoreArrayTitle = true;**
            options.ArrayAsTable = true;
            **options.IgnoreObjectTitle = true;** 
            JsonUtility.ImportData(jsonData, sheet.Cells, 0, 0, options);
            workbook.Save(ms, SaveFormat.Xlsx);
            return ms.ToArray();
        }

@EmiliFerrerStratesys,

Could you please zip and attach JSON data file, we will check it soon.

jsonData_test.7z (29.6 KB)

@EmiliFerrerStratesys,

Thanks for the JSON data.

I did test your scenario/case using your file. I noticed the issue/behavior as you mentioned, the header is rendered. But could you try the workaround to cope with it, I mean you may simply remove the first row. Please add a line of code to your code segment, i.e., add a line just before saving the Excel the file:


JsonUtility.ImportData(jsonData, sheet.Cells, 0, 0, options);
worksheet.Cells.DeleteRow(0);
workbook.Save(ms, SaveFormat.Xlsx);
return ms.ToArray();

Please let us know if the above workaround figures out your issue now?

1 Like

@EmiliFerrerStratesys
We have found your issue and log it with issue id CELLSNET-52281.

@EmiliFerrerStratesys,

This is to inform you that your issue has been resolved, so you don’t have to use the suggested workaround. The fix will be included in our upcoming release (Aspose.Cells 22.12) which is scheduled in the first half of December, 2022. You will also be notified when the next version is released.

The issues you have found earlier (filed as CELLSNET-52281) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi