Auto size height for rows in Apache POI

后端 未结 10 992
闹比i
闹比i 2020-12-08 18:47

I am inputting values into a spreadsheet using Apache POI. These values have newlines, and I was able to use this code successfully:

CellStyle style = cell.g         


        
10条回答
  •  暖寄归人
    2020-12-08 19:40

    You can't adjust cell height directly. But you can change the row's height

    final HSSFSheet fs = wb.createSheet("sheet1");
    final HSSFRow row0 = fs.createRow(0);
    final HSSFCell cellA1 = row0.createCell(0);
    row0.setHeight((short)700);
    

提交回复
热议问题