[#11446] - Spacing before Paragraph for DinamicTextFields

Category:
Bug report
Priority:
Normal
Status:
Feedback Requested
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

For a text field with dynamic content (in term of rows) the spacing before set to any value (in px) affects the Stretch with Overflow.

Case:
I have a text field (between two others) that, based on the value of a variable displays a text of two rows and for other values another text of 3 rows.
Textfield has font size set to 9 Arial, that's why I am considering 13px hight for each row and 9 px as spacing before resulting.

I Jasper Studio v 6.3.2 I create this textfield with total height of 13+13+9=35px; 9px as spacing before.

When generating report in the case when three rows has to be displayed - the third row is not visible.

If I remove the spacing before and I reduce the total size to 26px leaving those 9px between my text field and the previous one if works perfectly.

For my textfield it is now set:

<textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement key="" isPrintRepeatedValues="false" x="140" y="188" width="387" height="24" isRemoveLineWhenBlank="true" forecolor="#535B61" uuid="12345678-1234-1234-1234-123456789abc">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
</reportElement>
<textElement>
<font fontName="SansSerif" size="9"/>
<paragraph spacingBefore="0"/>
</textElement>
<textFieldExpression><![CDATA[$F{my_field}.equalsIgnoreCase("AAA") ? "Some text consisting in two rows" : "Some other test consisting in 3 rows"]]></textFieldExpression>
</textField>

v6.3
TextField
swatcat_ro's picture
Joined: Dec 21 2018 - 5:17am
Last seen: 2 weeks 6 days ago
Feedback