Expression Editor Help?

Hello,

What i want to do is, i have a field and if this field is NOT NULL, then count.

Here is the code below;

if($F{KISI_ID}.intValue() != null){
$V{count}.intValue()= $V{count}.intValue() + 1;
}

But it gives errors;

it.businesslogic.ireport.gui.logpane.ProblemItem@10e1ea8 Syntax error on token "(", ; expected Line 48, Column 23 /jasperReport/variable[1]/variableExpression[1] and

it.businesslogic.ireport.gui.logpane.ProblemItem@1feb264 Syntax error on token ")", delete this token Line 48, Column 23 /jasperReport/variable[1]/variableExpression[1]
raysefo's picture
67
Joined: Nov 13 2007 - 3:22am
Last seen: 15 years 10 months ago

3 Answers:

Try with the below expression

(condition) ? action : action
seemar's picture
12
Joined: Nov 18 2007 - 2:48pm
Last seen: 15 years 10 months ago
i m new to ireports. Would you please explain it a little bit more? Any samples how to create expressions?

thanks
raysefo's picture
67
Joined: Nov 13 2007 - 3:22am
Last seen: 15 years 10 months ago
You want to do this

( $F{KISI_ID}.intValue() != null ? $V{count}.intValue() + 1 : 0 )

or

( $F{KISI_ID}.intValue() != null ? $V{count}.intValue() + 1 : $V{count}.intValue())
svenn's picture
15052
Joined: Mar 19 2007 - 5:57am
Last seen: 16 years 6 months ago
Feedback
randomness