Jump to content

print when expression error


montero

Recommended Posts

Trying to print the Text Field in RED when the value is < 0,

BLACK when the value =0 and GREEN when the value is >0.

 

In the "Print when expression" to get the color

GREEN font I wrote:

Code:
$F{PCT_TRUE_DIFF}.comparTo(new BigDecimal(0)) >0  

 

In another field2 i have

Code:
[code]$F{PCT_TRUE_DIFF}.comparTo(new BigDecimal(0)) <0
to get the color RED font

 

and in field3 i have

Code:
[code]$F{PCT_TRUE_DIFF}.comparTo(new BigDecimal(0)) =0
to get the color BLACKfont

 

None of this is working as i get a "Cannot cast from boolean to boolean" error.

 

The fields are all BigDecimals btw. And i have 3 of them all on top of one another in the report detail band.

 

Any advice would be greatly appreciated as i haven't have the slightest clue as to why i would be getting this type of error.

 

Post edited by: rubedogg04, at: 2007/05/24 22:08

 

Post edited by: rubedogg04, at: 2007/05/24 22:09

 

Post edited by: rubedogg04, at: 2007/05/24 22:10

Post edited by: rubedogg04, at: 2007/05/24 22:11

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Is the error

 

"Cannot cast from boolean to boolean"

 

or is it

 

"Cannot cast from boolean to Boolean"

 

I'm thinking that your logic is generating a boolean when you want it to be generating a Boolean. If so try incasing your expression with

 

new Boolean( <your expression> )

Post edited by: svenn, at: 2007/05/25 15:48

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