NPOI设置单元格背景色在网上有好多例子都是设置为NPOI内置的颜色值 但是想用rgb值来设置背景色,即:通过HSSFPalette类获取颜色值时会抛出异常:Could not Find free color index 比如:http://www.cnblogs.com/yxhblog/p/6225018.html 最后找到 这个实现后才知道需要额外设置一步 http://www.cnblogs.com/huxiaolin/p/4813518.html 简化后代码如下: private voi
//Instantiating a Workbook object Workbook workbook = new Workbook(); //Adding a new worksheet to the Workbook object int i = workbook.Worksheets.Add(); //Obtaining the reference of the newly added worksheet by passing its sheet index Worksheet works