0
votes

I calculated sum of fields per page by using this answer https://stackoverflow.com/a/33613632/12746914

and I get the result as expected. the following lines describe what the answer contains:

ff_Reset_Total

whileprintingrecords;
numbervar PageTotl;
PageTotl:=0;

ff_Current_Total

whileprintingrecords;
numbervar PageTotl;
PageTotl;

ff_Add_Record

whileprintingrecords;
numbervar PageTotl;
PageTotl:=PageTotl + {TheField};

then place these formula fields in the report as under:

ff_Reset_Total in Page Header Section ff_Current_Total in Page Footer Section ff_Add_Record in your Details Section

My problem is I want to print the total of each field per page in the report footer for example total of column X in page 1 = 5, a total of column X in page 2 = 10 so a total of total = 15

first I need to know the number of pages to pass it as variable to report footer, so this line total of column X on page 1 = 5 will be total of column X on page Y = 5 How can achieve this? thanks in advance. this image exactly what I want

1

1 Answers

0
votes

Modify your ff_Add_Record formula to include a new variable that can be used to accumulate the totals from each page.

So your modified formula would look like this:

ff_Add_Record

whileprintingrecords;
numbervar PageTotl;
numbervar GrandTotl;
PageTotl:=PageTotl + {TheField};
GrandTotl := GrandTotl + PageTotl;
PageTotl;

The last line will ensure this field displays the total for the page, while the GranTotl variable will continue to accumulate the page totals as they are printed. Then you will need a new formula field to display the GrandTotl variable, which will look like this:

ff_Print_GrandTotl

whileprintingrecords;
numbervar GrandTotl;

Place this new formula field in the Report Footer section and it should now show you the grand total across all pages.