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!

Group Footer 'Sum Formula' resets at Page Break

Status
Not open for further replies.

AussieLad

Technical User
Jul 17, 2002
17
AU
I am trying to display the "Hours Worked" for Fleet items which are grouped by 'Vehicle Category' [Grp1] then by 'Fleet Item', [Grp2],(to get summary totals of fuel Qty & $ transactions). (n.b. Details section is suppressed).
I have also placed the 'HrsMeter' field onto GH2, (ie, along with the SUMMARISED fuel Qty & $), & need a summary of 'HrsMeter' in GF1.
I have tried to used the "3-formula trick" as follows...
Formula 1...WhilePrintingRecords; NumberVar Hrs:=0;
(Suppressed in GH1).
Formula 2...WhilePrintingRecords;NumberVar Hrs;Hrs:=Hrs+{MFFBS.HRSMETER} (Suppressed in GH2).
Formula 3...WhilePrintingRecords;NumberVar Hrs;
(Displayed in GF1).

Formula 3 seems to work OK, UNTIL a page-break !! ie, If a Group1 'Category' goes over one page, the summary total of HrsWorked only adds up the Group2 'Fleet Items' Hours on the LAST PAGE OF Grp1.

Is there a simple solution to this, or am I doing things the hard way in the first place ?!

Would appreciate any expert advice on this issue.



 
I'm guessing that you have have checked "repeat group header on each page" so that the reset formula is activated on each new page. Try changing your first formula to:

WhilePrintingRecords;
NumberVar Hrs;

if not inrepeatedgroupheader then Hrs := 0;

-LB
 
Thank You (x3) LB !!!

You've made all the detailed explanation of my problem worthwhile.

(This has been my "You learn something new every day" for today).
 
AussieLad, for future reports, you should consider using Running Totals or Summary Totals rather than NumberVar formulas. For most purposes they are a lot quicker and easier.

Madawc Williams
East Anglia, Great Britain
 
Thanks Madawc,

Will gladly accept tips from "the regulars" in this forum !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top