Skip to content

Commit

Permalink
πŸ”€ :: excel indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
lyutvs committed Mar 27, 2023
1 parent 24aa610 commit 2ef4cc6
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +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)
sheet.setColumnWidth(2, 5 * 256)
sheet.setColumnWidth(3, 5 * 256)
sheet.setColumnWidth(4, 37 * 256)
sheet.setColumnWidth(5, 37 * 256)

ByteArrayOutputStream().use { stream ->
workbook.write(stream)
Expand Down

0 comments on commit 2ef4cc6

Please sign in to comment.