Jump to content
Changes to the Jaspersoft community edition download ×

How to code a PRINT WHEN EXPRESION


jkeri

Recommended Posts

Need help to code PRINTE EXPRESSION , and not being a JAVA coder I dont know how.

 

IF fieldA starts with 'A' OR fieldB starts with 'B' OR fieldc starts with 'C"

 

This is what i coded but its not working:

Boolean.valueOf($F{U_TYPE}.startsWith( "Deglyc"))//Boolean.valueOf($F{U_TYPE}.startsWith( "Glyc"))//Boolean.valueOf($F{U_TYPE}.startsWith( "WB"))

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Close!  I'll give you the statement in 2 passes... first is paraphrased for readability...

Boolean.valueOf( <STATEMENT1> || <STATEMENT2> || <STATEMENT3>)

where <STATEMENT1> is $F{U_TYPE}.startsWith( "Deglyc") etc. etc.

 

So total answer would be:

Boolean.valueOf($F{U_TYPE}.startsWith( "Deglyc") || $F{U_TYPE}.startsWith( "Glyc") || $F{U_TYPE}.startsWith( "WB"))

 

I'd have to test... but this should work also...

OR($F{U_TYPE}.startsWith( "Deglyc") ,$F{U_TYPE}.startsWith( "Glyc"),$F{U_TYPE}.startsWith( "WB"))

 

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