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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing 2 variables from 2 subreports

Status
Not open for further replies.

pomster

Technical User
Jan 15, 2003
88
AU
I have a report with 2 subreports in GH2 that each have a variable that is passed back to the main report.

Sub1

//@BillingCost1
WhilePrintingRecords;
Shared currencyVar ContractBillCost ;

sub2

//@BillingCost2
WhilePrintingRecords;
Shared currencyVar ContractBidPrice;

I can add these 2 together quite easily in GF2 but I need a total in GF1. I'm nearly there but not quite!

Thanks in advance,

David

 
So in GF1 you want the sum of all of the Group 2's, right?

In GH1 use

//@BillingCost1
WhilePrintingRecords;
Shared currencyVar ContractBillCostTot:= 0 ;
Shared currencyVar ContractBidPriceTot:= 0;

In GF2 use:
//@BillingCost1
WhilePrintingRecords;
Shared currencyVar ContractBillCost ;
Shared currencyVar ContractBidPrice;
Shared currencyVar ContractBillCostTot :=
Shared currencyVar ContractBidPriceTot := ContractBidPriceTot+ContractBidPrice;

In GF1 use
//@BillingCost1
WhilePrintingRecords;
Shared currencyVar ContractBillCostTot;
Shared currencyVar ContractBidPriceTot;
ContractBillCostTot+ContractBidPriceTot

-k
 
Ooops:

In GF2 use:
//@BillingCost1
WhilePrintingRecords;
Shared currencyVar ContractBillCost;
Shared currencyVar ContractBidPrice;
Shared currencyVar ContractBillCostTot := ContractBillCostTot+ContractBillCost;
Shared currencyVar ContractBidPriceTot := ContractBidPriceTot+ContractBidPrice;

-k
 
Thanks very much, spot on again!

Regards,


David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top