NPOI 设置背景颜色

使用FillBackgroundColor不会起作用,不能使用自定义的颜色。

设置背景颜色代码:

HeadercellStyle.FillPattern = FillPattern.SolidForeground;
HeadercellStyle.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.RoyalBlue.Index;

 

相关链接:

https://www.niceonecode.com/Question/20373/Unable-to-set-FillBackgroundColor-using-HSSFWorkbook-in-CSharp

https://stackoverflow.com/questions/31159724/npoi-setting-background-color-isnt-working

posted @ 2021-07-01 17:15  舒碧  阅读(1580)  评论(0编辑  收藏  举报