Topic: Help to show discrepancy between fields Posted: 02 Jul 2012 at 10:12pm
I hope someone can help with this problem. I am trying to highlight anomalies between fields in a crystal report. I have one field which comes from a table of data and indicates from that if there was a rescue carried out (yes or no) and 2 other fields which show the number of rescues either by one means or another (Field is a number). I want to highlight the rescue field when it is 'no' but there is a number in either of the other two fields. I hope I have made this clear and any help appreciated. Thanks
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Posted: 03 Jul 2012 at 3:46am
Right-click on the yes/no field and select Format.... Go to the Border tab. Turn on the Background color and click on the formula button to the right of the color drop-down list. Using your field names, use a formula that is similar to this:
If IsNull({table.Value1}) and IsNull({table.Value2}) then crNoColor
else if not IsNull({table.Value1}) and {table.Value1} > 0 then crYellow
else if not IsNull({table.Value2}) and {table.Value2} > 0 then crYellow
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 03 Jul 2012 at 3:46am
use a conditional background color formula on the field you want to draw attention to
if you have Nulls in the data set make sure to flip the option in the formual editor to use defualt values for nulls, otherwise it won't highlight if any of the 3 fields are null
if table.rescue='No' and (table.means1>0 or table.means2>0) then crRed else crnocolor
Edited: Sorry Hilfy, didn't mean tyo double answer...was typing when you posted.
oops - spoke too soon - It is only highlighting the 'no's' where there is a figure in 'means 1 ' If Means 2 has a 1 or a 2 in it it is staying 'no colour' Any ideas? Cheers
if {IRS_VICTIMS.WASRESCUED} ='No' and ({INCIDENT_FIRES.RESCUES_FS}>0 or {INCIDENT_FIRES.RESCUES_NOT_FS}>0) then crRed else crNoColor
It is highlighting the 'No' if there is a figure in RESCUES_FS but not if it is in RESCUES_NOT_FS as you can see from the extract below. The fifth entry should be highlighted.
ah - it didnt copy the format - row 2,3,and 4 had the 'No' highlighted but the 5th wasnt!!Sorry not a good copy the heading align left and the figures right!!
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