diff --git a/src/main/java/com/flowingcode/vaadin/addons/gridexporter/ExcelInputStreamFactory.java b/src/main/java/com/flowingcode/vaadin/addons/gridexporter/ExcelInputStreamFactory.java index 8a39829..8150386 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/gridexporter/ExcelInputStreamFactory.java +++ b/src/main/java/com/flowingcode/vaadin/addons/gridexporter/ExcelInputStreamFactory.java @@ -274,9 +274,7 @@ private void buildRow(T item, Sheet sheet, Cell startingCell) { Cell currentCell = startingCell; if (startingCell.getColumnIndex() < currentColumn[0]) { currentCell = startingCell.getRow().createCell(currentColumn[0]); - CellStyle newCellStyle = currentCell.getSheet().getWorkbook().createCellStyle(); - newCellStyle.cloneStyleFrom(startingCell.getCellStyle()); - currentCell.setCellStyle(newCellStyle); + currentCell.setCellStyle(startingCell.getCellStyle()); configureAlignment(column.getTextAlign(), currentCell); } @@ -402,9 +400,7 @@ private void fillHeaderOrFooter( sheet .getRow(sheet.getActiveCell().getRow()) .createCell(sheet.getActiveCell().getColumn()); - CellStyle newCellStyle = cell.getSheet().getWorkbook().createCellStyle(); - newCellStyle.cloneStyleFrom(style); - cell.setCellStyle(newCellStyle); + cell.setCellStyle(style); } Object value = (isHeader