Tips and Tricks
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Tips and Tricks
Message Icon Topic: Grand Total summary Post Reply Post New Topic
Author Message
billym17
Newbie
Newbie


Joined: 23 Oct 2009
Online Status: Offline
Posts: 7
Quote billym17 Replybullet Topic: Grand Total summary
    Posted: 26 Oct 2009 at 8:09am
I created a report with  a column that calculates commission but I cannot summarize it. I want to get a grand total of the commissions.
I appreciate any help or if you can direct me to the right formula to do this. Thanks

Here is the formula
// This tests the number of chits per day for a class in indoor fitness and claculates the commission
// sorts indoor fitness sales items
if {tblPOSItems.POSItemCode} startswith "N" then
//counts chits and determines if chits are less than or equal to 5
(if count({tblPOSChits_ItemDetails.POSChitDate},{tblPOSChits_ItemDetails.POSChitDate}) <= 5
// if true chit amount will be commission amount
then {tblPOSChits_ItemDetails.GrossAmount}*1.0
// if chits are over 5 then commission will be only 70%
else {tblPOSChits_ItemDetails.GrossAmount}*.7)
else {tblPOSChits_ItemDetails.GrossAmount}*.7
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 30 Oct 2009 at 11:58am
since you want a sum of the commission, life is pretty simple.
add a variable into the formula...well here something like:
 
shared numbervar totCom;
local numbervar thisCom;
 
/ This tests the number of chits per day for a class in indoor fitness and claculates the commission
// sorts indoor fitness sales items
if {tblPOSItems.POSItemCode} startswith "N" then
//counts chits and determines if chits are less than or equal to 5
(if count({tblPOSChits_ItemDetails.POSChitDate},{tblPOSChits_ItemDetails.POSChitDate}) <= 5
// if true chit amount will be commission amount
then thisCom:={tblPOSChits_ItemDetails.GrossAmount}*1.0
// if chits are over 5 then commission will be only 70%
else thisCom:={tblPOSChits_ItemDetails.GrossAmount}*.7)
else thisCom:={tblPOSChits_ItemDetails.GrossAmount}*.7;
 
totCom:=totCom + thisCom;
thisCom
basically set the current commision to a variable, since CR displays the last value that it sees, you need the current commision at the bottom of the formula, the rest is a simple incrementing.
 
HTH
 
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.031 seconds.