Skip to Content
0
May 01, 2014 at 01:28 PM

Text highlight color

158 Views

I'm attempting to covert a comma-delimited list of text to space-delimited, colored text. I want the text highlight to blue and the text itself to be red.

To do so, I've created a formula that will generate HTML:


// result => "one","two","three"

Local Stringvar Array values:=Split({table.field},",");

// HTML elements

Local Stringvar style:="color:red;background-color:blue;";

Local Stringvar span:="<span style='" + style + "'>";

Local Stringvar end:="</span>";

// create HTML string

span + Join(values, end + span) + end;

I've set the formula field's text interpretation to HTML.

This produces a space-delimited list of values, where the text is red. The values' background is still white, however.

I've had similar results using RTF syntax and RTF text interpretation.

Does Crystal Reports (2008) support the 'background-color' CSS attribute? Which CSS attributes does CR support?