Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Display detail function total in group footer Post Reply Post New Topic
Author Message
ohioguy_tim
Newbie
Newbie
Avatar

Joined: 11 Dec 2008
Location: United States
Online Status: Offline
Posts: 9
Quote ohioguy_tim Replybullet Topic: Display detail function total in group footer
     Posted: 19 Aug 2009 at 1:52pm
Hello
 
I have created a detail function total that executes at detail time.  I want to display the result in a group footer without executing the detail function at group footer time. Right now my detail function works fine but when I put it in my group footer it add the last detail line AGAIN and displays an incorrect total in my group footer. How can I display the result of my detail function without executing it again in the footer when I want the total to display?
 
Thank you. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Aug 2009 at 2:00pm
I assume you mean a variable formula...
Create another formula to display the final result
IP IP Logged
ohioguy_tim
Newbie
Newbie
Avatar

Joined: 11 Dec 2008
Location: United States
Online Status: Offline
Posts: 9
Quote ohioguy_tim Replybullet Posted: 20 Aug 2009 at 5:56am
Hello DBlank
 
Thank you for replying back.
 
Yes I have a variable formula called UNITS. Here is the formula I have for UNITS:
 
WhilePrintingRecords;
Global NumberVar units;
units := units + ({Command.EVECEQ} / 15);
 
I have this variable in my detail section and is working correctly. It calculates the units and keeps a running total of units until I reset it to zero on the next group header.
 
I created another variable called DisplayUnits. Here is the formula I have for DisplayUnits:
 
 
I have it placed in my group footer. What its doing is executing my UNITS variable again then displaying the result in the group footer. The last record in each group is being executed twice instead of once. I need DisplayUnits to just display the result of UNITS not execute it again.
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Aug 2009 at 7:24am
Header Reset
WhilePrintingRecords;
Global NumberVar units;
units := 0
 
Details
WhilePrintingRecords;
Global NumberVar units;
units := units + ({Command.EVECEQ} / 15);
 
Footer Display
WhilePrintingRecords;
Global NumberVar units;
units := units
IP IP Logged
ohioguy_tim
Newbie
Newbie
Avatar

Joined: 11 Dec 2008
Location: United States
Online Status: Offline
Posts: 9
Quote ohioguy_tim Replybullet Posted: 20 Aug 2009 at 7:35am
Thank you DBlank. That worked.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Aug 2009 at 8:06am
FYi - you can also create a one formula field called "Units" as:
({Command.EVECEQ} / 15)
 
Then just do a SUM of this @units using the insert summary at any group level you want.
This can be palced on the Header or footer where as the other process must be the footer.


Edited by DBlank - 20 Aug 2009 at 8:07am
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