Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Background Colours Post Reply Post New Topic
Author Message
gpmatthews
Newbie
Newbie
Avatar

Joined: 20 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote gpmatthews Replybullet Topic: Background Colours
    Posted: 29 Jul 2010 at 11:04pm
How do i go about setting a forumla to highlight when a specific word apears in a data field, but it might come in different sentences?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2010 at 3:17am
do you mean you want that only that word highlighted in the string or so you want the string highlighted regardless of the location of the word within the string?
IP IP Logged
gpmatthews
Newbie
Newbie
Avatar

Joined: 20 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote gpmatthews Replybullet Posted: 30 Jul 2010 at 3:53am
The word can appear anywhere in a sentence, e.g. if the word 'stock' appears in the sentence i want backgrond colour to turn red. hope that helps
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2010 at 4:36am
right click on the field and selct format
click on the formula option next to the backgroupund color and use:
if instr({table.field},'stock',1)>0 then crred else crnocolor
 
this will return it as red if the string stock is found anywhere which also means inside other words like stockade.
Does this work for you?
IP IP Logged
gpmatthews
Newbie
Newbie
Avatar

Joined: 20 Aug 2009
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote gpmatthews Replybullet Posted: 30 Jul 2010 at 4:44am
Like a dream, cheers mate
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.000 seconds.