We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Multi Level Grouping - Aspose Cells

Is it possible to do multi-level grouping like in the attached spreadsheet? I also included a sample dataset.

I tried using Cells.GroupRows, but it doesn’t seem to work correctly when going into the second level of grouping

Hi Varun,


Thank you for contacting Aspose support.

You can achieve your goal using the Cells.GroupRows method alone. If you wish to create a multi-level grouping, that is; grouping with in grouping, all you have to do is to create a larger group lets say from row 2 to 17 and then create a smaller group referencing the rows between the previously assigned range, such as 3 to 8. Please check the below provided code snippet for your reference.

C#

//Accessing the cells of first worksheet
var cells = worksheet.Cells;

//Creating a larger group spanning between row 2 and row 17
cells.GroupRows(1, 16, false);
//Creating a smaller group spanning between row 3 and row 8
cells.GroupRows(2, 7, false);

Please feel free to contact us back in case you need our further assistance with Aspose APIs.