Using Aspose.Cells 4.8.2.0
I seem to have stumbed across an issue regarding setting the indent level of cells when the cells are merged. I have the following base style setup:
Style = Workbook.Styles[Workbook.Styles.Add()];
Style.Name = "SideElement";
Style.HorizontalAlignment = Aspose.Cells.TextAlignmentType.Left;
Style.VerticalAlignment = Aspose.Cells.TextAlignmentType.Center;
Style.Borders.SetStyle(Aspose.Cells.CellBorderType.Thin);
Style.Borders.DiagonalStyle = Aspose.Cells.CellBorderType.None;
Style.IsTextWrapped = true;
Style.Font.Size = 8;
Style.Number = 49;
Style.Indent=0;
I then create a worksheet with several cells each of which span 2 rows. I apply the style as:
aCell.GetMergedRange().Style = aSideElement;
if (vElement.Indent > 0)
{
aCell.GetMergedRange().Style.IndentLevel = vElement.Indent;
}
For example I have 8 merge cells and cells 3, 4 and 5 should have an Indent of 1. I'm seeing:
- The first indented cell set it indent = 1 is not indented in the Excel output.
- The next cell does get indetn=1, however all cells after this get indent = 1.