Jump to content
We've recently updated our Privacy Statement, available here ×

Print when expression with collectionToCommaDelimitedString


tim.westhoff

Recommended Posts

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 :)

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...