Apache POI - issue with cell background color

Viewed 34

I want to color an Excel cell with blue color :

HSSFCellStyle headerCellStyle = worksheet.getWorkbook().createCellStyle();
headerCellStyle.setFillBackgroundColor(HSSFColor.BLUE.index);
headerCellStyle.setFillPattern(CellStyle.FINE_DOTS);

cell = rowHeader.createCell(startColIndex++);
cell.setCellValue("Titre");
cell.setCellStyle(headerCellStyle);

enter image description here

The cell should be blue instead of grey. I don't understant what I am doing wrong.

0 Answers
Related