From 64227ef0a9df5c43b1211ba92a0128ec604640d3 Mon Sep 17 00:00:00 2001 From: lyutvs Date: Mon, 27 Mar 2023 11:33:27 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=80=20::=20excel=20Width=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xquare/v1servicepoint/point/spi/ExcelSpiImpl.kt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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 6c16c26..05780dd 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 @@ -62,17 +62,11 @@ class ExcelSpiImpl( insertDataListAtRow(headerRow, attributes, getHeaderCellStyle(workbook)) dataList.forEachIndexed { idx, dataLists -> - sheet.autoSizeColumn(idx+1) - sheet.autoSizeColumn(1) - sheet.autoSizeColumn(2) - sheet.autoSizeColumn(3) - sheet.autoSizeColumn(4) - sheet.autoSizeColumn(5) - sheet.autoSizeColumn(6) - sheet.autoSizeColumn(7) val row = sheet.createRow(idx + 1) + sheet.autoSizeColumn(idx + 1) insertDataListAtRow(row, dataLists, getDefaultCellStyle(workbook)) } + sheet.setColumnWidth(1, 7 * 256) ByteArrayOutputStream().use { stream -> workbook.write(stream)