Skip to Content

How to change the field background color in CR using HTML?

Oct 17, 2017 at 10:23 PM


avatar image


I have a cross-tab in the report. I need to change background color of the summary field based on the database field HEX value. For this I'm interpreting field as HTML. So I created the formula fields and trying to use HTML tags to format it. I can change the font color OK, like this:

<FONT COLOR="' & {Report_SELECT_TagLayouts.FontHex} & '">' & {Report_SELECT_TagLayouts.TagColorAbbreviation} & '</FONT>

But I cannot figure out how to change the background color. I have a database field for this - {Report_SELECT_TagLayouts.BackgroundColorHex}, but even if I just use regular HEX values it doesn't work. I've tried different tags - div, span etc. - no luck.

I would appreciate your suggestions.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ian Waterman Oct 18, 2017 at 09:29 AM

Crystal only supports a limited number of HTML tags

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you. Yes, I'm using only these tags, nothing works. Cannot find anything that would change the background color. Font color is fine.

Ian Waterman Oct 19, 2017 at 07:45 AM

I think that is your problem. Once you select use HTML interpretation no other formatting works.

Check this by turning off HTML interpretation and see if back ground colour works. You could try overlaying or underlaying a text box with conditional background colour.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Thank you. The problem is that I don't see an alternative to HTML. I have HEX colors in the database which CR don't support, but HTML does. If I use conditional formatting, I have to limit the colors to those supported by CR, i.e. crBlue, crRed etc., but I have way more colors than that.


You can use RGB () function to define any colour.

eg RGB(x,y,z) where x, y and z define your Red, Green and Blue levels



Thank you. Yes, there is also function Color. But I don't have RGB, I have HEX, which is HTML thing, so I need to convert it first. It would be much easier to work with HTML.