Jump to content

how to color a box in the table??


tetef

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello

   According to my knoweledge dynamic formatting is not directly provided

you can do this using "Print when Expression".

you should create 2 boxes A & B

box A color red and box B yellow color

now in box A print when expression use expression like

new Boolean ($F{severity} == 1?true:false)

and in box B print when expression use expression like

new Boolean ($F{severity} == 2?true:false)

this will help U.

Link to comment
Share on other sites

I never tested for this use, but perhaps is it also possible to use conditionnal style, that is to set the background color for example according to a boolean expression. It's more "light" to manipulate than several boxes and "print when".

I have already used that for alternate color stripes in the detail section, by putting the text fields inside a frame which has a conditionnal style driven by the value of "report_count modulo 2".

I don't know if it is possible with a crosstab object



Post Edited by Gabriel Entressangle at 03/29/09 17:39



Post Edited by Gabriel Entressangle at 03/29/09 17:40

PS : there is also a "style" property in a crosstab "box", so I think that the conditionnal style may be used to have different  background colors.



Post Edited by Gabriel Entressangle at 03/29/09 17:49
Link to comment
Share on other sites

  • 1 year later...

The modulo 2 works also fine in the detail band!

Create a filled rectangle around the details and attach the following expression to the "print when expression" property:

line 1 : no rectangle printed

line 2 : rectangle printed

line 3 : no rectangle printed

line 4 : rectangle printed

etc...

 

Code:
new Boolean($V{REPORT_COUNT}.intValue()%new Integer(2).intValue()==0)
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...