How to replace null value to other string words

0

I'm trying to replace null value to '-' value however i can't find the way of doing this.

i googled and found the anwser to using (F{fieldName} == null ? '-' : F{fieldName} ) function but it doesn't work.

ksj2805's picture
Joined: Aug 20 2019 - 12:10am
Last seen: 3 weeks 6 days ago

3 Answers:

0

Try checking if the field is not null and just reverse the results:

<textFieldExpression><![CDATA[$F{fieldName} != null ? $F{fieldName} : "-"]]></textFieldExpression>

DerekGannaway's picture
Joined: Mar 17 2017 - 9:58am
Last seen: 1 week 4 days ago
1

Chcck if there are any spaces. 

(F{fieldName} == null || F{fieldName}.trim() == "") ? "-" : F{fieldName}

srkr's picture
23
Joined: Dec 16 2014 - 12:21pm
Last seen: 4 weeks 23 hours ago
0

$F{Field} == null? $F{SQL SELECT} : $F{Another Field}

zain.nabi's picture
Joined: Apr 11 2019 - 5:05am
Last seen: 4 weeks 5 hours ago
Feedback
randomness