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

PrintWhen expression and/or condition


pumaking

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Just a minor addition, I recently had a problem with conditional statements and subreports. i recommend this minor change to  augarte's suggestion:

(($F{Field1}==new Integer(1).intValue() && $F{Field2}!=new Integer(0).intValue()) ? Boolean.TRUE : Boolean.FALSE)

It appears that at least in version 4.1.3 failure to explicitly define a integer value as such can in some circusmstances result in it being treated as a  string value, thereby causing a class cast exception at runtime.

Link to comment
Share on other sites

Hi,

Not sure how could yo do this, maybe this could work:

(($F{Field1}.intValue () ==new Integer(1).intValue() && Integer.parseInt($F{Field2})!=new Integer(0).intValue()) ? Boolean.TRUE : Boolean.FALSE)

In this case I assume that Field1 is BigDecimal and Field2 is string type.

Hope this helps.

Regards.

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