0
我有這樣的代碼來嘗試設置單元格的背景顏色(除其他事項外):爲什麼給單元格設置顏色不起作用(Aspose Cells)?
private static readonly Color CONTRACT_ITEM_COLOR = Color.FromArgb(255, 255, 204);
. . .
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);
水平和垂直對齊作品的設定一樣,大膽的和高度 - 一切,但顏色:
還需要什麼?我甚至嘗試設置ForegroundColor以及背景顏色,來:
style.ForegroundColor = Color.Red;
style.BackgroundColor = Color.Blue;
...但同樣沒有任何東西 - 細胞仍然看起來完全一樣,上面的截圖。