Jump to content

How to ask for more then 1 string?


jojolino

Recommended Posts

Hi forum!

I am absolutely new on iReport. I work with a Java based time management system. The developer has integrated iReport to create queries and reports from this application. So I must learn something about this...

My actual problem:

I want to print a field only if the data (string) contains some values.
My code works only with one sting but I must ask for more than this one.
This is how it looks at the moment:

new Boolean($F{AdjBalancesNext[18]}.contains("1"))

But I want to print out also if the field contains "2" or "3".

I tried this: new Boolean($F{AdjBalancesNext[18]}.contains("1", "2", "3")) but I get an error.

How must this look?

Thanks!

Jürgen

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

try to learn more basic concepts about java programming :)

try to use:

new Boolean($F{AdjBalancesNext[18]}.contains("1")||($F{AdjBalancesNext[18]}.contains("2")||($F{AdjBalancesNext[18]}.contains("3"))

note that:
||     ==> uquals a OR condition...
&& ==> equals an AND condition

 

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



Post Edited by slow at 04/21/2010 14:02
Link to comment
Share on other sites

Thanks!

It must be:

new Boolean($F{AdjBalancesNext[18]}.contains("1")||$F{AdjBalancesNext[18]}.contains("2")||$F{AdjBalancesNext[18]}.contains("3"))

 

This works perfectly!

Thank you very much and I have added KARMA ponts to you!

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