This is actually Grouping that you have referenced through your provided sample spreadsheet. Yes, you can achieve this with Aspose.Cells for Java. Please check the below linked technical article for your reference.
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 10 to 18, and then create a small group referencing the rows between the previously assigned range, such as 12 to 16.
Please have a look at the below provide code snippet and attached resultant spreadsheet (sheet2).
Java
//Instantiating a Workbook object
Workbook workbook = new Workbook(path);
//Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.getWorksheets().get(1);
//Accessing the cells of first worksheet
Cells cells = worksheet.getCells();
//Creating a larger group spanning between row 10 and row 18
cells.groupRows(9, 17, false); //Creating a smaller group spanning between row 12 and row 16
cells.groupRows(11, 15, false);
//Saving the modified Excel file in default (that is Excel 2003) format
workbook.save(myDir + “output.xls”);
It is good to know that the sample code and article link was helpful for you. Let us know if you encounter any other issue, we will be glad to look into it and help you further.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.