I have a problem with HSSFWorkbook object. I have a XLS template, where first row is dark gray, and next rows are light gray. During generation of the report, I want to change the background color of few cells (works perfectly) for red/blue. But after calling:
HSSFCellStyle style = workbook.createCellStyle();
style.setFillBackgroundColor(...)
or:
HSSFCellStyle style = workbook.getCellStyleAt(0) [default style of the workbook]
style.setFillBackgroundColor(...)
the styles of whole sheet is lost. The header becomes violet, and the rest cells becomes dark-dark-gray. I love violets, but I need my colours from the XLS not being changed.
In short - styles from my XLS template are not being preserved after I change style of one cell in the way described above.
I'm out of ideas. Please help.
Mateusz