POI操作Excel背景颜色设置

 

POI操作Excel时背景颜色设置为:

CellStyle cell=workbook.createCellStyle();
cell.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
cell.setFillPattern(FillPatternType.SOLID_FOREGROUND);

 

颜色参看参数: