Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: equal to formula Post Reply Post New Topic
Author Message
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Topic: equal to formula
    Posted: 11 Aug 2016 at 8:20am
Hello,
I have 2 fields in my report - order_qty and Job_run_qty
I want the Job_run_qty to be highlighted yellow only if it doesn't equal the job order qty.  It seems easy enough but I can't seem to get it to work I was using trying to have it print red but that didn't work at all either.  Here is what I had:
if ({Job_run_qty} = {order_qty}) then CRBlack else CRRed
Please help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Aug 2016 at 10:40am
1. where are you placing this formula?
2. This is per row with each field in that row and not any summarized data, correct?
2. are you comparing the actual data or are you rounding in your display? Sometimes the one record has a different decimal value in it that might be rounded in the view on the report canvas but not the actual data.
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 11 Aug 2016 at 11:13am
1.  I am placing the formula in the Group Header section - Jobs
2. The order qty field has 1 number what ever is entered (for example 1 piece) the Job_run_qty is whatever is entered by by the people that are working on the job.
3.  Actual data should be whole numbers
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Aug 2016 at 11:24am
I am interpreting your answer to mean that the you want something in the group header (the entire background?) to change color and that this is like the max value of the Qty field for the group = the sum of the run qty value for the group. Does that sound correct?
IP IP Logged
figgy
Newbie
Newbie


Joined: 19 Nov 2013
Online Status: Offline
Posts: 23
Quote figgy Replybullet Posted: 12 Aug 2016 at 2:47am
I would like only the Job_run_qty field to be highlighted if it does not match the job_qty.  
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Aug 2016 at 3:53am
right click on the Job_run_qty field
select format field
select border tab
click on the formula button (x-2) next to Background
add your formula here
if table.Job_run_qty <> table.job_qty then crYellow else crNoColor
IP IP Logged
figgy
Newbie
Newbie


Joined: 19 Nov 2013
Online Status: Offline
Posts: 23
Quote figgy Replybullet Posted: 12 Aug 2016 at 4:47am
It worked!! I'm not sure why my formula didn't work?
Thank you so much for your help!
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.008 seconds.