在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
本文介绍如何在iReport中设置文本字段(textField)的高度根据内容自动调整。通过选中textField并启用属性StretchWithOverflow,可以让textField随内容变化而自适应高度。此外,虽然默认情况下Stretchtype为NoStretch,但即使修改为RelativeToBandHeight,textField同样会自适应高度。
846

被折叠的 条评论
为什么被折叠?



