trying to write to work book and change the cell colour using…
CellStyle style = wb.createCellStyle();
style.setFillBackgroundColor(IndexedColors.BLUE.getIndex());
style.setFillPattern(CellStyle.ALIGN_FILL);
for (int i = 0; i < headerTitles.length; i++) {
Cell cell = headerRow.createCell(i);
cell.setCellValue(headerTitles[i]);
cell.setCellStyle(style);
}
However it seems to output the colour with just a foreground of grey dots and I cant seem to work out why.
Secondly what is the method to set the width of a cell automatically, or even the first 5 columns of a work book.
Regards
For the second question, use this method: