Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Rep group summary Post Reply Post New Topic
Author Message
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Topic: Rep group summary
    Posted: 24 Sep 2014 at 11:05am
Running CR 10 Pro

Got a report that shows profit totals for each sales person and breaks down by total -today and today +30. The math is correct, in that it appears to have the correct dollar amounts but it doesn't reset to 0 for each rep.

Calculation formula below is placed in the details section and the -T formula is placed in the GH for the rep.

What it is shows...
Rep      Detail   Profit -T     Profit to 30
John D    
          40.00
          60.00
          50.00
                     100.00            50.00
----------------------------
Sally R    
          25.00
          25.00
                     150.00            50.00       

Sally R's totals should show "Profit -T"=50.00 and "to 30"=0.00 instead including the dollar amounts from the previous rep, should reset to zero before doing her calculations.


**** Calculation formula: *****
WhilePrintingRecords;

CurrencyVar L9PriorToToday;
CurrencyVar L9LessThan30;

If Not IsNull ({tblOpportunities.EstimatedCloseDate}) then
If (DTSToDate ({tblOpportunities.EstimatedCloseDate}) < (Today))
then (L9PriorToToday := L9PriorToToday + {tblQuotes.Profit})
else If (DTSToDate ({tblOpportunities.EstimatedCloseDate}) <= (Today) + 31)
then (L9LessThan30 := L9LessThan30 + {tblQuotes.Profit})

**** -T formaula ****
WhilePrintingRecords;

CurrencyVar L9PriorToToday;
IP IP Logged
z9962
Senior Member
Senior Member
Avatar

Joined: 04 Jul 2012
Online Status: Offline
Posts: 161
Quote z9962 Replybullet Posted: 24 Sep 2014 at 10:06pm
You need to reset your variable to 0.
 
Add this new formula to the Group Header
 
CurrencyVar L9PriorToToday:=0;
CurrencyVar L9LessThan30:=0;
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 25 Sep 2014 at 5:06am
Thank you but where in the group header would I add the new formula?
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 09 Oct 2014 at 11:53am
Can someone please help, z9962 offered a suggestion but I'm not sure where to place the formula?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Oct 2014 at 3:57am
place it anywhere in the group header.
It will reset your L9PriorToToday and L9LessThan30 to 0 in the header then on each detail section it starts to roll up again, then the next GH sets it back to zero and repeats.
 
you can even suppress it so it does not clutter your display


Edited by DBlank - 10 Oct 2014 at 3:58am
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 10 Oct 2014 at 7:07am
Ok thanks. I have four group headers and tried placing the formula in each of them as well as the detail and the GF section where the calculations are occurring to no avail.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Oct 2014 at 7:12am
change them to shared variables or add in the
whileprintingrecords;
 
only need the new formula in one group header


Edited by DBlank - 10 Oct 2014 at 7:17am
IP IP Logged
rlivermore
Groupie
Groupie


Joined: 27 Sep 2012
Online Status: Offline
Posts: 70
Quote rlivermore Replybullet Posted: 10 Oct 2014 at 7:24am
Whileprintingrecords did the trick, thank you very much!
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.014 seconds.