Setting Column width in Apache POI

前端 未结 5 1242
闹比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:35

    Please be carefull with the usage of autoSizeColumn(). It can be used without problems on small files but please take care that the method is called only once (at the end) for each column and not called inside a loop which would make no sense.

    Please avoid using autoSizeColumn() on large Excel files. The method generates a performance problem.

    We used it on a 110k rows/11 columns file. The method took ~6m to autosize all columns.

    For more details have a look at: How to speed up autosizing columns in apache POI?

提交回复
热议问题