jc1992
jc1992

Reputation: 644

Check if is null JasperReports

I have the following problem with JasperReports , I receive the content correctly , however when the content is null i am interesting to not showing nothing.

Could anyone help to me?

<textField>
    <reportElement x="0" y="0" width="100" height="20"/>
    <box leftPadding="10"/>
    <textElement/>
    <textFieldExpression><![CDATA[$F{nombre}]]></textFieldExpression>
</textField>

Upvotes: 0

Views: 3264

Answers (1)

sanBez
sanBez

Reputation: 933

Set "blank when null" checkbox at property of field

enter image description here

After that definition text filed in jrxml like this:

        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            ....
            <textElement textAlignment="Left" verticalAlignment="Middle">
                <font fontName="DejaVu Sans" size="12"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{leftColumn}]]></textFieldExpression>
        </textField>

Upvotes: 1

Related Questions