Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: If One Record <= Another Record Post Reply Post New Topic
Author Message
kerrylinnea
Newbie
Newbie


Joined: 23 Feb 2015
Location: United States
Online Status: Offline
Posts: 5
Quote kerrylinnea Replybullet Topic: If One Record <= Another Record
    Posted: 21 Aug 2015 at 5:39am
I believe this to be a simple task but for some reason I just cannot get it to work.

Make the On Hand Quantity Green if on hand quantity is greater than or equal to ordered quantity.

I thought it would be as easy as:
if {Command.On_Hand_Qty} <= {Job.Order_Quantity} then crGreen

I would really appreciate some help!!
Thanks :)
Kerry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2015 at 5:37am
is this a row level comparison or is this some cumulative value comparison?
Is this a field background color?
a row color?
font color?
IP IP Logged
kerrylinnea
Newbie
Newbie


Joined: 23 Feb 2015
Location: United States
Online Status: Offline
Posts: 5
Quote kerrylinnea Replybullet Posted: 24 Aug 2015 at 6:23am
The On Hand Quantity is a Command, sum of On Hand Qty from my software. The Order Quantity is just a pull from the software.
I am hoping to make the font of the On Hand Quantity green if it is greater than or equal to the Order Quantity.
Kerry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2015 at 6:42am
did you place both values (the command field and the order qty) in the row and verify that your data inside the report is accurate across all of your rows?
make sure this in the detail section not a group header of footer.


Edited by DBlank - 24 Aug 2015 at 6:43am
IP IP Logged
kerrylinnea
Newbie
Newbie


Joined: 23 Feb 2015
Location: United States
Online Status: Offline
Posts: 5
Quote kerrylinnea Replybullet Posted: 24 Aug 2015 at 6:45am
Yep - all the values are accurate. And yes, it is in the detail section.
Kerry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2015 at 6:49am
right click on the field
select format field
select font tab
select the formula box next to the color
use your formula there but you have to specify the else, I used crblack in the example

if {Command.On_Hand_Qty} <= {Job.Order_Quantity} then crGreen else crBlack
IP IP Logged
kerrylinnea
Newbie
Newbie


Joined: 23 Feb 2015
Location: United States
Online Status: Offline
Posts: 5
Quote kerrylinnea Replybullet Posted: 24 Aug 2015 at 6:53am
I did try that, that (with the else...) was actually my first formula, but no luck :(
Kerry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2015 at 6:56am
this field is on the detail row?
next to the two fields you are using
{Command.On_Hand_Qty}, {Job.Order_Quantity}
and it always returns the else (crBlack)?
IP IP Logged
kerrylinnea
Newbie
Newbie


Joined: 23 Feb 2015
Location: United States
Online Status: Offline
Posts: 5
Quote kerrylinnea Replybullet Posted: 24 Aug 2015 at 9:22am
I apologize for the delay!
I wish there was a way I could paste a Snip of the report in here.
I got it to work on one subreport.
But the other subreport doesn't 'use' Job.Order-Quantity, although it is part of the selected database. Could that be why it doesn't like it?
Kerry
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2015 at 5:30am
are you trying to compare a subreport to the main report?
Just because the subreport is displayed in the section (detail row) does not mean the value exists in the main report as something that can be compared to. YOU could pass shared variables back and forth to use that.
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.047 seconds.