I've a problem with the library apache poi, i want to copy the style of a cell and to do this i use the function cloneStyleFrom() and all works good except the copy of borders style. I don't understand if is my mistake or if this function doesn't implements the copy of the borders style.
This is my code:
int stHashCode = oldCell.getCellStyle().hashCode();
XSSFCellStyle newCellStyle = styleMap.get(stHashCode);
if (newCellStyle == null) {
newCellStyle = newCell.getSheet().getWorkbook().createCellStyle();
newCellStyle.cloneStyleFrom(oldCell.getCellStyle());
styleMap.put(stHashCode, newCellStyle);
}
newCell.setCellStyle(newCellStyle);
Someone can help me? Where is my mistake?
Thanks