Hi
I am working on converting VSTO project to Aspose cells.
we have below code in existing project…please let me know how to use OutlineLevel using aspose cells.
If xlWs.Rows(y).OutlineLevel = 2 Then
Thanks in advance.
Hi,
If you need to specify summary row below or summary column right while grouping rows/cols, you may try to use Worksheet.Outline attribute for your needs.
e.g
Sample code:
Workbook excel = new Workbook(“e:\test2\Book1.xlsx”);
Worksheet worksheet = excel.Worksheets[0];
worksheet.Cells.GroupColumns(5, 6, true);
worksheet.Cells.GroupColumns(8, 9, true);
worksheet.Outline.SummaryColumnRight = true;
Thank you.
Hi,
Below is the code we have used.
Could you please suggest how to use this property in aspose and also let me know the importance of the below statement.
If xlWs.Rows(y).OutlineLevel = 2 Then
Thank you so much.
Hi,
Thanks for providing further details.
Well, you may try to use Cells.GetGroupedRowOutlineLevel()/ Cells.GetGroupedColumnOutlineLevel() method for your needs, see the sample code segment below.
e.g
Sample code:
Workbook book = new Workbook(“f:\test2\Book1.xlsx”);
Worksheet sheet = book.Worksheets[0];
for (int i = 0; i <= sheet.Cells.MaxRow; i++)
{
int rowOutlineLevel = sheet.Cells.GetGroupedRowOutlineLevel(i);
if (rowOutlineLevel == 2)//zero-based
{
//…
}
}
…
Hope, this helps a bit.
Thank you.
Thank you so much for your valuable response. Will try the same and let you know in case of any help.
What is the equivalent code in aspose. Want to get the entire row count using aspose.
Sheet1.Cells.CurrentRegion.Rows
Thanks in advance.
Hi Amjad,
I am having an issue with GetGroupedRowOutlineLevel property. I am working in aspose migration project and I am using below code
For y = 2 To recordcnt
If xlWs.Rows(y).OutlineLevel = 2 Then
rowOutlineLevel = xlWs.Cells.GetGroupedRowOutlineLevel(y)
– Logic Placed.
as per logic condition only satisfies only if y=3,8,15,29,54,86 where as it is not happening in aspose code.
Please help.
Hi,
Well, I am not sure what issue you are facing using relevant APIs (e.g Cells.GetGroupedRoOutlineLevel() etc. of Aspose.Cells. Could you create a sample runnable console application (you may zip it prior attaching here) with Aspose.Cells APIs to show the issue. Also provide your input and output files via Aspose.Cells APIs, we will check it soon. Please provide complete details by inserting comments with each line when you bebug/ evaluate the conditions via Aspose.Cells APIs in your codes, it will help us really to understand you and to help you though.
Thank you.