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

sum of variable by group

Status
Not open for further replies.

atarrqis

IS-IT--Management
Nov 26, 2004
155
US
Cr8.5 and Oracle
In the Main report I have 3 groups
Grp1 = Project
Grp2 = Sub-Proj
Grp3 = Activity
and one subreport at Grp3a Footer shows Total Material
with a shared variable
@GLMat
WhilePrintingRecords;
Shared NumberVar GLMaterial := Sum ({GEN_LED_VOUCHER_ROW.CURRENCY_AMOUNT}, {GEN_LED_VOUCHER_ROW.CODE_E})


I have a shared variable in the Main report
@Material
WhilePrintingRecords;
Shared NumberVar GLMaterial

that correctly displays
Total Material from the subreport in Grp3b footer (suppressed).

I reset this in Grp3 Header (suppressed)
@Reset_Mat
NumberVar GLMaterial := 0;

Now I want to sum the value of Material for both Grp1 and Report Total
In Grp1 footer I have
@Display_Proj
NumberVar ProjMat;

In Grp1 header I have
@Reset_Proj
NumberVar ProjMat := 0;

I have
@Proj
NumberVar ProjMat := ProjMat + {@material};
Seems like this should go in Grp3b footer
but no matter where I put it I cannot get the sum for Projects, not to mention
a Report Total of Material.

What am I doing wrong?
Thanks.

 
I think that you havce a few things to change:

I reset this in Grp3 Header (suppressed)
@Reset_Mat
SHARED NumberVar GLMaterial := 0;

and

@Proj
SHARED NumberVar GLMaterial;
NumberVar ProjMat := ProjMat + GLMaterial;

Reference the shared variables, not the formulas containing them.


I didn't analyse this too closely because you seem like you understand programming just fine, you just overlooked a few details, I'm guessing that you'll get it straightened out now.

-k
 
ok, that got me on the right track. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top