From 534c83cfe02a04ba4e995c12bb77db254682064f Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Tue, 26 Dec 2023 15:43:12 +0900 Subject: [PATCH] =?UTF-8?q?values(dataset,=20keysAndStyles)=20cellStyle=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EA=B4=80=EB=A0=A8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/base/file/xls/XLSWriter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } }