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!

reset running total or sum on page break 1

Status
Not open for further replies.

jenlion

IS-IT--Management
Nov 13, 2001
215
This should be simple, I think.

I have a field (orderqty) that I want to summarize for each page, and then show the total for at the end of the report.

I think I should be able to keep 2 running totals, and display one that resets on page break at the bottom of each page, and display the other, which never resets, at the end of the report.

I can't seem to find a way to do this. Tried summaries and running totals, and I can't figure out how to make it reset on a page break. Can someone point me in the right direction?

Thanks
 
Create four formulas:

{@resetpagetot} to be placed in the page header:
whileprintingrecords;
numbervar pagetot := 0;

{@pagetotgrtot} to be placed in the details section:
whileprintingrecords;
numbervar pagetot := pagetot + {table.amount};
numbervar grtot := grtot + {table.amount};

Substitute your amount field for {table.amount}.

{@displaypagetot} to be placed in the page footer:
whileprintingrecords;
numbervar pagetot;

{@displaygrtot} to be placed in the report footer:
whileprintingrecords;
numbervar grtot;

You might want to format the report footer with "new page before" so that the page total on the last page is not below the grand total. Once you have done this, the page footer on the new last page will show "0"--you can format this field by going to format->field->number->customize and check "suppress if zero."

-LB
 
Running totals and summaries do not take notice of pages. For this you need numbervar values, as lbass details.

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top