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

Do not suppress the last group footer on each group

Status
Not open for further replies.

sto837

Technical User
Aug 11, 2009
20
US

Hi experts,

I would like to not suppress the last group footer 2b on each group so it can act like a group footer 1 when I do a manual sum.

Now
Group footer 2a (group by name)
Group footer 2b
Group footer 2a
Group footer 2b
Group footer 2a
Group footer 2b

Become
July
Group footer 2a
Group footer 2a
Group footer 2a
Group footer 2b
---------------------------
August
Group footer 2a
Group footer 2a
Group footer 2a
Group footer 2b
---------------------------
September
Group footer 2a
Group footer 2a
Group footer 2a
Group footer 2b

Can this be done? The real problem I am having is when I do a manual sum, it always add twice when it reaches to the footer. Therefore, if I put the manual sum formula in group footer 2b instead of group footer 1, it would be adding up correctly.

Thanks
 
What are the conditions which cause 2a to repeat.

Use the condition for the 3rd 2a to switch a boolean

@init// place this in group 2 header header can be suppressed
while printingrecords;

global booleanvar switch:=false

@eval// palce this in 2a footer and suppress formual so not visible
If Whatever condition for 3rd 2a is = true then switch:=true

In 2b section expert

while printingrecords;

global booleanvar switch =false // Note no : before equal

Ian

 
It sounds like you might be placing the accumulation formula in the group #1 formula. Instead you should just reference the variable. So your formulas should be something like this:

//{@reset} in the GH1:
whileprintingrecords;
numbervar tot;
if not inrepeatedgroupheader then
tot := 0;

//{@accum} to be placed in the group #2 header or footer:
whileprintingrecords;
numbervar tot := tot + sum({table.amt},{table.group2field}); //just a guess at what you're totalling

//{@displayresult} to be placed in the Group Footer #1:
whileprintingrecords;
numbervar tot;

-LB
 
// {@SUPPR2B}
IF ONLASTRECORD
THEN 0
ELSE
IF {GROUP1FIELD} = NEXT(GROUP1FIELD}
THEN 1
ELSE 0

Then your print suppression for your Group 2B footer is: {@SUPPR2B} = 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top