Change Text color based on a character in string
Printed From: Crystal Reports Book — Forum Name: Technical Questions
Posted By: ibdavid — 14 Sep 2016 at 8:05am
I'm looking to change the color of text displayed, based on a special character being present. If, in this case a "?" is present in the text string, I'd like the text to be highlighted Red. I've tried various commands in the "display string" settings, however wildcards aren't recognized and I'm having difficulty making this happen. Thanks for any suggestions or guidance!
Posted By: kevlray — 14 Sep 2016 at 11:02am
If you use the formula for the font (Format Field, Font). I believe you can use special characters by recursing it by a \, (i.e., '\?'). Thus you can do something like this if instring({somefield},'\?') > 0 then crred else crblack
Posted By: ibdavid — 19 Sep 2016 at 6:23am
Excellent, thank you! Trying now.
|