Free Support Forum - aspose.com

AutoFitRows expands hidden grouping

Hi ...this also applies for AutoFitRow method.

regards

Rale

Workbook wb = new Workbook();

wb.Worksheets.Clear();

Worksheet ws = wb.Worksheets.Add("New");

ws.Cells[5, 5].PutValue(34);

ws.Cells[5, 5].Style.Font.Size = 23;

ws.Cells.GroupRows(3, 9, true);

ws.AutoFitRows();

wb.Save(@"Result.xlsx", FileFormatType.Excel2007Xlsx);

Hi,

Thank you for considering Aspose.

Well, it is the behavior of MS Excel. If you group the rows first and then AutoFit them, rows will get expended. You may try to autofit the rows first and then group them.

Workbook wb = new Workbook();

wb.Worksheets.Clear();

Worksheet ws = wb.Worksheets.Add("New");

ws.Cells[5, 5].PutValue(34);

ws.Cells[5, 5].Style.Font.Size = 23;

ws.AutoFitRows();

ws.Cells.GroupRows(3, 9, true);

wb.Save(@"Result.xlsx", FileFormatType.Excel2007Xlsx);

Thank You & Best Regards,