Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Saving a detail line date to display in footer Post Reply Post New Topic
Author Message
hippity
Newbie
Newbie


Joined: 06 Dec 2010
Location: United States
Online Status: Offline
Posts: 2
Quote hippity Replybullet Topic: Saving a detail line date to display in footer
     Posted: 06 Dec 2010 at 9:41am
This should be easy & I'm not sure what I've missed. I am trying to capture a datetime value on the detail line to display in the footer. I am not dealing with null values, and I am gouping on EVENT_TYPE.
 
My first try at this was to use this formula {@Arrived Time} on the detail line:
WhilePrintingRecords;
if {ED_IEV_EVENT_INFO.EVENT_TYPE}='50'
then {ED_IEV_EVENT_INFO.EVENT_TIME}
 
With this formula, {@Arrived Time} is valued properly on the detail line only, but not in the group footer.
 
For my second try to set {@Arrived Time} value, I've placed the following {@Set Times} formula on the detail line to capture a qualifying date into {@Arrived Time} Note that I removed the earlier formula: 
WhilePrintingRecords;
if {EVENT_INFO.EVENT_TYPE}='50'
Then {@Arrived Time}={EVENT_INFO.EVENT_TIME} ;
 
{@Arrived Time} never shows up with a value, regardless of which section of the report that I try to display it. I know that the {@Set Times} formula above is executing properly, because I am printing it to see if it is true or false.
 
 
Thanks :)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Dec 2010 at 10:14am
You are setting the value for each row so when you place this in the group footer it is showing your the value (blank) from the last row in the group.
You can either do a MAX value on that, or add 2 more formulas to manage it and reset on the group footer level or use a running total. I perfer RTs.
You can use MIN or MAX as needed depending on which you want to see. I am assuming MAX time value here
RunningTotal
Name=MAX_ArriveTime
Field to Summarize={ED_IEV_EVENT_INFO.EVENT_TIME}
Type = Maximum
Evaluate= Use a formula
{ED_IEV_EVENT_INFO.EVENT_TYPE}='50'
Reset = on change of group (select Event_Type)
Place in Event_Type group footer
IP IP Logged
hippity
Newbie
Newbie


Joined: 06 Dec 2010
Location: United States
Online Status: Offline
Posts: 2
Quote hippity Replybullet Posted: 07 Dec 2010 at 1:44am
Thanks for your help, the running total works. I was getting messed up with the fact that there is only one type=50 per group, and I was not coding a reset for the formula within the group, there was no 'ELSE' clause, so I thought it would stick.
Thanks :)
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