Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Change Text color based on a character in string Post Reply Post New Topic
Author Message
ibdavid
Newbie
Newbie


Joined: 31 Aug 2016
Location: United States
Online Status: Offline
Posts: 2
Quote ibdavid Replybullet Topic: Change Text color based on a character in string
    Posted: 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!
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 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
IP IP Logged
ibdavid
Newbie
Newbie


Joined: 31 Aug 2016
Location: United States
Online Status: Offline
Posts: 2
Quote ibdavid Replybullet Posted: 19 Sep 2016 at 6:23am
Excellent, thank you! Trying now.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.