I was looking at the POST to create a multi level collapsible grouping in Excel using EPPlus, but I am not able to create a inner group within an existing group.
Please see the example file I am using here
It seems, I need to set the OutlineLevel for Row 14- 18 twice, first to set them at level 3 and also again to set them at level 2 as part of the larger group (Row 10 - 27), and it's only taking the level 2 value, not showing the inner level.
Let me know if there is a way to achieve it using EPPlus.
Thanks in advance!!
You can achieve this if you think of creating outer level first, then create inner level (using C#).
// 0. populate with basic data
worksheet.Cells[1, 1].Value = "outside"; // | outside | |
worksheet.Cells[2, 2].Value = "inside"; // | | inside |
worksheet.Cells[3, 1].Value = "outside"; // | outside | |
// 1. outter level
for(int i=1; i<=3; i++)
{
worksheet.Row(i).OutlineLevel = 1;
worksheet.Row(i).Collapsed = true;
}
// 2. inner level
worksheet.Row(2).OutlineLevel = 2;
worksheet.Row(2).Collapsed = true;
Result: