From 24aa610a84c8243a5c6974798f314ef6ab1b30f7 Mon Sep 17 00:00:00 2001 From: lyutvs Date: Mon, 27 Mar 2023 11:44:56 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=80=20::=20autoSizeColumn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xquare/v1servicepoint/point/spi/ExcelSpiImpl.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/point-infrastructure/src/main/kotlin/com/xquare/v1servicepoint/point/spi/ExcelSpiImpl.kt b/point-infrastructure/src/main/kotlin/com/xquare/v1servicepoint/point/spi/ExcelSpiImpl.kt index 05780dd..e1754f5 100644 --- a/point-infrastructure/src/main/kotlin/com/xquare/v1servicepoint/point/spi/ExcelSpiImpl.kt +++ b/point-infrastructure/src/main/kotlin/com/xquare/v1servicepoint/point/spi/ExcelSpiImpl.kt @@ -61,11 +61,17 @@ class ExcelSpiImpl( val headerRow = sheet.createRow(0) insertDataListAtRow(headerRow, attributes, getHeaderCellStyle(workbook)) + sheet.autoSizeColumn(3) + sheet.autoSizeColumn(4) + sheet.autoSizeColumn(5) + sheet.autoSizeColumn(6) + dataList.forEachIndexed { idx, dataLists -> val row = sheet.createRow(idx + 1) sheet.autoSizeColumn(idx + 1) insertDataListAtRow(row, dataLists, getDefaultCellStyle(workbook)) } + sheet.setColumnWidth(1, 7 * 256) ByteArrayOutputStream().use { stream ->