Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Passing a value between groups for evaluation Post Reply Post New Topic
Author Message
skinfreak
Newbie
Newbie
Avatar

Joined: 29 Jan 2009
Online Status: Offline
Posts: 18
Quote skinfreak Replybullet Topic: Passing a value between groups for evaluation
     Posted: 21 Mar 2012 at 6:22am
Hi there,

I have a group which features several times (for sake of argument Times 1 -4). Each group row will have sequential times so that the rows are always chronological accurate. For example


Time 1 Time 2 Time 3 Time 4 TimeDiff
Row 1 12:15 12:20 13:00 13:10 00:00
Row 2 14:48 14:53 15:26 15:36 01:38
Row n





What I need to find out is the difference between Time 1 on Row 2 from Time 4 on Row 1. In the above example the 01:38 is the calculation I am after. Row 1 will not calculate as it is at the top of the group.

I have constructed a formula with DoWhilePrinting records but cannot remember how to pass values between each group? I am sure I cracked it before but the knowledge has...leaked!


Edited by skinfreak - 21 Mar 2012 at 10:48pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Mar 2012 at 8:02am
shared or global variables
 
shared numbervar x;
 
x := y;
"" //hide the formula's output.
IP IP Logged
skinfreak
Newbie
Newbie
Avatar

Joined: 29 Jan 2009
Online Status: Offline
Posts: 18
Quote skinfreak Replybullet Posted: 21 Mar 2012 at 10:52pm
What I am getting stuck on is passing the variable between groups.

The first formula I am using is converting the

Shared timeVar TATPass;
TATPass := ctime({Time 4})

The output of this needs to be passed to the next group footer to permit the calculation.

Once completed and printed, the variable needs to be reset for the group footer in which the previous calculation has been carried out.
IP IP Logged
skinfreak
Newbie
Newbie
Avatar

Joined: 29 Jan 2009
Online Status: Offline
Posts: 18
Quote skinfreak Replybullet Posted: 22 Mar 2012 at 12:27am
It  is ok - i got there in the end. I think I ended up confusing myself...
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Mar 2012 at 7:47am
ok, it sounds like from your description that you would want 2 variables...
 
but you already got it figured out, and that is what counts.
IP IP Logged
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