Reputation: 1525
I'm trying to write the SQL query in iReport with LIKE syntaxis.
I write query with :
... AND voc_agent.id LIKE '%$P!{LABEL}%'
It is works. But know I want check the P{LABEL} on NULL
I wrote
... $P!{LABELL}
$P!{LABELL} = ($P!{LABEL}==null? "" :"AND voc_agent.id LIKE '%" + $P{LABEL}+ "%'")
The result is :
Error filling print... Error evaluating expression : Source text : ($P{LABEL} == null ? "" : "AND voc_agent_commercial_terms.label LIKE '%" + $P{LABEL} + "%'")
What I'm doing wrong?
Upvotes: 0
Views: 581
Reputation: 1223
afaik conditional expressions are not working in queries. how about using a variable instead? put your conditional expression into a string variable and use the variable inside the query.
Or see the link that lisa posted: "Rolling up" groups in Jaspersoft iReport
it's a much better answer ;)
Upvotes: 1