cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

Hello,

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Crystal only supports a limited number of HTML tags

https://apps.support.sap.com/sap/support/knowledge/public/en/1217084

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Ian

Former Member
0 Kudos

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.