Setting Column width in Apache POI

前端 未结 5 1248
闹比i
闹比i 2020-12-13 11:56

I am writing a tool in Java using Apache POI API to convert an XML to MS Excel. In my XML input, I receive the column width in points. But the Apache POI API has a slightly

5条回答
  •  没有蜡笔的小新
    2020-12-13 12:34

    With Scala there is a nice Wrapper spoiwo

    You can do it like this:

    Workbook(mySheet.withColumns(
          Column(autoSized = true),
          Column(width = new Width(100, WidthUnit.Character)),
          Column(width = new Width(100, WidthUnit.Character)))
        )
    

提交回复
热议问题