Skip to content

Commit

Permalink
πŸ”€ :: autoSizeColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
lyutvs committed Mar 27, 2023
1 parent 64227ef commit 24aa610
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down

0 comments on commit 24aa610

Please sign in to comment.