在iReport中设置textField的高度根据内容自动变高.
选中一个textField,在属性中找到 Stretch With Overflow 并选中即可。
还有一个属性叫Stretch type ,默认的值是No Stretch,可以改成Relative To Band Height。但是改不改textField的都会自适应(奇怪)。
Relative To Band Height 的含义可以在 JRElement.STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT 看到
The graphic element will adapt its height to match the new height of the report section it placed on, which has been affected by stretch.
JRElement是JRDesignTextField的Interface