Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Variable and Subtotals, Totals-

Status
Not open for further replies.

ricolame

IS-IT--Management
Nov 9, 2005
82
CN
Hi guys,

my report has finally come close to an end.. ok i have 3 subreports generated for a part record. Each subreport has a shared variable (avg price field) to the main report depending on certain conditions.

Now, i have a problem doing summing of subtotals. I have a Qty field for the part in the main report.

My {@evalTotalCost} : {sharedvariable}*Qty

As all these values are evaluated after selection, i could not perform summing using the summary option nor running total fields for it

How should i go about doing my subtotal for the group i have and the final grand total sum ?

Any help is greatly appreciated! Thanks
 
Simply create a new a formula to sum the totals for each row/record i.e.

Code:
//@Accumulate
Shared Numbervar sharedvariable;
Global NumberVar TotalCost := TotalCost + sharedvariable*Qty ;

Then create a 2nd formula to display the total in the group footer section

Code:
//@Display
Global NumberVar TotalCost;

Finally you will need to reset the variable for each group, place this in the group header section

Code:
//@Display
Global NumberVar TotalCost = 0;

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
hi i'm trying that now . just thinking on my head what happens to my grand sum if i do such a reset.

anyway thanks for the direction..will work on that
 
If you want a grand sum simply add another variable to the accumulate formula which doesn't reset and then create a new formula to display the final result of that variable.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top