Apache POI Cell - getCellStyle and CellStyle - setCellStyle gives different background colour

494 Views Asked by At

I'm trying to copy a cell style (background color, format, etc) and set that to another cell.

Using this methods:

CellStyle style = originalCell.getCellStyle();
newCell.setCellStyle(style);

CellStyle cellstyle = workbook.createCellStyle();
cellstyle.cloneStyleFrom(originalCell.getCellStyle())

But somehow the new cell style has different background color then the original one.

This is how my cell backgrounds looks like

Thats the result

Any suggestion why is that?

0

There are 0 best solutions below