Hello,
I asked this question on stackOverflow here but have been hearing a cricket chorus over there.
So I'll put it here:
I know how to vertically center cell values when they can be defined by their row location, namely get a reference to them, create a style, assign values to the style, and then assign the style to the cell, like so:
cell = pivotTableSheet.Cells[4, 0];
cell.PutValue(AnnualContractProductsLabel);
style = cell.GetStyle();
style.HorizontalAlignment = TextAlignmentType.Center;
style.VerticalAlignment = TextAlignmentType.Center;
style.Font.IsBold = true;
pivotTableSheet.Cells.SetRowHeight(4, 25);
style.BackgroundColor = CONTRACT_ITEM_COLOR;
pivotTableSheet.Cells[4, 0].SetStyle(style);
But what about for recurring values, such as those that are generated for a PivotTable?
I create a row value like so:
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Row, DESCRIPTION_COLUMN);
pivotTable.RowHeaderCaption = "Description";
...which appears like this (the values beneath "Description" such as "Anise, *" and "Artichokes, *", "Asparagus, *" etc.):
[ the question on StackOverflow has a screenshot; I couldn't figure out how to add it here, although I did upload it. ]
I want those values vertically centered, rather than at the top. How can I manage that?
BTW, I posted a tip on using Aspose Cells to create a Pivot Table here.