Free Support Forum - aspose.com

Grouping Rows and Columns in Excel

Hi,

I want to group rows in excel. I am using GroupRows function of Aspose.Cells dll.

When I expand the + sign it drills records down with the - sign. How can I keep the + and - sign at the top always when expanded also.

Attached is the expected and actual behavior.

Thanks,

Hetal

Hi,

Attached both Expected and Actual xls file. We are using 2007 with xls files.

Thanks,

Hetal

Hi,


Thanks for the sample files.

Please use Outline.SummaryRowBelow boolean attribute to false. See the sample code for your reference.

Sample code:

Workbook designer = new Workbook();
Worksheet worksheet = designer.Worksheets[0];
//Add some text
for (int i = 0; i < 100; i++)
{
for (int j = 0; j < 3; j++)
{
worksheet.Cells[i, j].PutValue(“Dummy content”);

}
}

worksheet.Cells.GroupRows(13, 18, false);
worksheet.Outline.SummaryRowBelow = false;
designer.Save(“e:\test2\outgrptemplate.xls”);

Thanks for the quick reply. This works perfect and I was able to generate the expected output using above suggested code.

Thanks,

Hetal

Hi,

Thanks for your feedback.

It’s good to know that this issue is resolved using SummaryRowBelow property.

Please also see the following documentation article relating to Grouping/Ungrouping for your complete reference.

Let us know if you face any other issue, we will be glad to assist you further.

Please also download and try the latest Offline Demos of Aspose.Cells for .NET to get more grasp of Aspose.Cells API quickly.

These demos use the latest version of Aspose.Cells for .NET and can be run offline using Visual Studio 2005 , 2008 and 2010 .