Jump to content
Changes to the Jaspersoft community edition download ×

Print when expression


hpmxxx

Recommended Posts

Hello, I'm a newbie on iReport (v1.3.0). I have a problem to make a "Print when expression" work. This is my code:

Code:
new Boolean($F{sales_document_headertext1}.length() > 0 || 
$F{sales_document_title}.length() > 0)

The part which doesn't work is the logical OR operator. What am I doing wrong here? Could somebody give me a hint please?

 

Thanks,

Hans-Peter

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Unable to test this, but it should be something like:

 

new java.lang.Boolean($F{sales_document_headertext1}.length() > 0 ? TRUE : FALSE)

 

 

Of course you could deal in other data types, such as String:

 

new java.lang.String($F{sales_document_headertext1}.length() > 0 ? "TRUE" : "FALSE")

 

 

or numerics:

 

new java.lang.Integer($F{sales_document_headertext1}.length() > 0 ? 1 : 0)

 

 

or whatever you please. Have fun.

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