jojolino Posted April 21, 2010 Posted April 21, 2010 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
slow Posted April 21, 2010 Posted April 21, 2010 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
jojolino Posted April 21, 2010 Author Posted April 21, 2010 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!
slow Posted April 21, 2010 Posted April 21, 2010 excuse me for omitting the ${F in the expression... you have maked it your own :)thanks.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now