Apache POI 中行的自动调整高度 [英] Auto size height for rows in Apache POI
本文介绍了Apache POI 中行的自动调整高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 Apache POI 将值输入到电子表格中.这些值有换行符,我能够成功使用此代码:
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.getCellStyle()
style.setWrapText(true)
cell.setCellStyle(style)
不幸的是,虽然文本正确换行,但行的高度并不总是增长到足以显示内容.如何确保我的行始终是正确的高度?
Unfortunately, while the text is wrapping correctly, the rows are not always growing in height enough to show the content. How do I ensure that my rows are always the correct height?
推荐答案
currentRow.setHeight((short)-1)
适用于 XSSFCell 和 Excel 2013
Works for XSSFCell and Excel 2013
这篇关于Apache POI 中行的自动调整高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文