diff --git a/src/main/java/cokr/xit/base/file/xls/XLSWriter.java b/src/main/java/cokr/xit/base/file/xls/XLSWriter.java index 0d3292b..1979514 100644 --- a/src/main/java/cokr/xit/base/file/xls/XLSWriter.java +++ b/src/main/java/cokr/xit/base/file/xls/XLSWriter.java @@ -10,6 +10,7 @@ import java.util.Map; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; +import java.util.stream.Stream; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.CellStyle; @@ -368,9 +369,14 @@ public class XLSWriter extends XLS { if (!isEmpty(dataset)) { int c = cell.getColumnIndex(), r = cell.getRowIndex(); + Object[] kas = Stream.of(keysAndStyles) + .map(obj -> !(obj instanceof Styler) ? obj : cellStyle((Styler)obj)) + .toList() + .toArray(); + for (Map rec: dataset) { cell(r, c); - rowValues(rec, keysAndStyles); + rowValues(rec, kas); ++r; } }