Print when expression with collectionToCommaDelimitedString

0

Hello,

I’m using iReport 5.6.0 and I have two Text Fields. The first is listing my observers comma-separated.

 

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement mode="Transparent" x="239" y="155" width="244" height="15" uuid="7704e09f-2c07-4449-a326-72d05ab2964c"/>

<box leftPadding="5">

<leftPen lineWidth="1.0" lineColor="#FF6600"/>

</box>

<textElement verticalAlignment="Middle"/>

<textFieldExpression><![CDATA[de.hlsolutions.taskworker.util.JsonUtils.collectionToCommaDelimitedString($F{observer}, ".user.display")]]></textFieldExpression>

</textField>

 

The second one should show “no observers”, if there is no observer.

 

<textField>

<reportElement x="239" y="155" width="244" height="15" uuid="f14b17fb-f479-44d4-8ef3-9f4ad16b1798">

<printWhenExpression><![CDATA[$F{observer}.equals( null )]]></printWhenExpression>

</reportElement>

<box leftPadding="5">

<leftPen lineWidth="1.0" lineColor="#FF6600"/>

</box>

<textElement verticalAlignment="Middle">

<font isItalic="true"/>

</textElement>

<textFieldExpression><![CDATA[$R{task.filter.noObserver}]]></textFieldExpression>

</textField>

 

I tried to achieve this with a Print when expression $F{observer}.equals( null ) but it’s not working because the other text field is never gone be null.

I hope this will work with another Print when expression.

Tank you :)

tim.westhoff's picture
Joined: Apr 18 2016 - 5:56am
Last seen: 10 months 2 weeks ago

1 Answer:

0

Print When Expression: $F{supporters}.isMissingNode()

Thats it :)

tim.westhoff's picture
Joined: Apr 18 2016 - 5:56am
Last seen: 10 months 2 weeks ago
Feedback