Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Text Colour within field

Status
Not open for further replies.

bernie321

Programmer
Jan 7, 2004
477
GB
Hi

Is it possible to highlight/change the txt colour of specific words that appear within the text of a string field in crystal 10?

For example if I wanted to turn the colour of the text 'Fox' in a field that returned "The quick brown fox."

Any advice would be much appreciated

Thanks

B
 
You can do it by using a combination of the Replace function, and setting the Text Interpretation of the formula to HTML text. Using your example, you would begin by creating a formula:

//@ColorText
StringVar x := "The quick brown fox jumped over the lazy dog";
Replace(x,"fox","<font color = red>fox</font>");

Drag the formula onto the report canvas > right click > Format Field > Paragraph tab > set Text Interpretation to HTML Text.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top