Jump to content

Printing each cell with different background color


augarte

Recommended Posts

Hi,

I want to print the background of the cells in my report. The logic for printing the cells is not based in the values that are shown in these cells. I use an xml datasource and the information about the background color of each cell is stored in the xml file as an attribute. I have been searching if there is any posibility for doing that but didn't found nothing. I have previously used conditional styles but this functionality applies conditional formating for each column, and I need to do it for each cell.

Thanks in advance.

Kind regards,

Aitor.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 3 months later...

Hi Augarte,

Have you tried to use a Frame behind your cell in detail band and do a print when expression?
I would add several Frames with the color you wish and opaque at the back of each cell that you want to have a conditional backgroud color and then update the print When Expression property of the Frame to have it displayed or not depending on your data in the xml datasource. Be carefull to send the Frames of different color to the back so that It doesn't hide your data.

Hope that help,

Raphael.

Link to comment
Share on other sites

With the previous methode I have successful output but not in all format, Excel doesn't seem to show the background color.

Another way to do it and prbably better would be to create a new Style (right click Styles in the report inspector) and then add your conditional Styles with right click on your Style name. Each conditional style have a big set of properties for font color etc... The expression should return a Boolean so you may need enter something like "New Boolean($P{param1}>yourValue)" then this style will be aplied when param1 is higher than yourValue. This is an example, you have a big flexibility there.

Raphael

--
Please increase my Karma if it helped

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