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

Text Field Error


bgao16

Recommended Posts

Hi, all:

I am trying to display  a text instead of numbers in a text field, such as

($F{CommStatus}==2 ? "Comm Failed" : "Normal"), but I got the error message like

Error filling print... Error evaluating expression :      Source text : ($F{COMMSTATUS}==2 ? "Comm Failed":"Normal") 
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :      Source text : ($F{COMMSTATUS}==2 ? "Comm Failed":"Normal") 

I am using 3.7.3. Any idea what's wrong with this? Thx!

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I suppose your CommStatus is an Integer or a BigDecimal... so the correct form is:

$F{CommStatus}.IntValue()==2 ? "Comm Failed" : "Normal"

 

_________________________________________

if it works... give me KARMA points please!    : ) 
_________________________________________

listening:  Nine Inch Nails - Complication

Link to comment
Share on other sites

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...