My problem
I need to exactly copy cells from XSSFWorkbook
s and HSSFWorkbook
s to a new XSSFWorkbook
. So my cells can be of both types: XSSFCell
and HSSFCell
.
By exactly, I mean that I also need to copy the CellStyle
including the CellBorder
and CellFill
properties as well as the DefaultRowHeight
and DefaultColumnWidth
of the workbook itself. Also the height and width for each row and column should be copied.
(Copying CellStyle
sometimes results in strange behaviour like I already asked here).
My question
What's the best way to do this? I don't want to copy each property manually by myself. Especially if I don't know if my input cells are of type XSSFCell
or HSSFCell
.