Setting Column width in Apache POI

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

    I answered my problem with a default width for all columns and cells, like below:

    int width = 15; // Where width is number of caracters 
    sheet.setDefaultColumnWidth(width);
    

提交回复
热议问题