[#12931] - Comparing two strings with Jasper inner function EXACT

Category:
Bug report
Priority:
Normal
Status:
New
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

When I try to compare two values I have an error

ERROR PrintJasperService:338 - net.sf.jasperreports.engine.fill.JRExpressionEvalException:
Error evaluating expression for source text: //EXACT($P{id}, "14" ) ? "FLASH" :$P{name}

$P{id} I get out from an array: $P{map}.get("{id}")==null? " ":$P{map}.get("{id}")
So value of $P{id} can not be NULL
The type of $P{id} is java.lang.String

I tried compare with 'equals' but got the same error:
ERROR PrintJasperService:338 - net.sf.jasperreports.engine.fill.JRExpressionEvalException:
Error evaluating expression for source text: $P{id}.equals("14") ? "FLASH" :$P{name}

What I do wrong?

v6.3.1
ireport studio
Serhon75's picture
Joined: May 7 2018 - 8:09am
Last seen: 1 week 4 days ago

1 Comment:

#1

When I did small test report and tried this functions I saw that in this small report all this functions are working. So reason is in data after getting it from map array. "id" in array is as integer, but I saved it after getting out from array as class java.lang.String and if you only display this parameter then everything works but in conditions I couldn`t use this one.

Feedback