是否可以在EPPlus中为整列设置样式?我希望我可以使用 Column
方法,但是当我这样做时,我会得到奇怪的结果:
//Sets all cells in all columns to Red
worksheet.Column(1).Style.Font.Color.SetColor(Color.Red);
//Sets some cells in column B to red.
worksheet.Column(2).Style.Font.Color.SetColor(Color.Red);
在这两种情况下,我在添加一些 Headers 行之后设置颜色,但在添加大量行之前,我没有在其他地方设置颜色 . 我也得到了类似的意外结果设置水平对齐 . 目前我不得不在单元格级别设置样式 .
我使用不正确还是这个错误?使用EPPlus 3.1.2.0和Excel 2010(14.0.6129.5000) .
2 回答
尝试使用范围;我也遇到了使用数字的问题 .
希望这有效,但我没试过 .