I Have a Crystal Report and get the sum of a field like this:
Sum({TheField})
and I put it in PageFooter section to have it in all pages but if the report has multiple pages it shows the sum of all fields and I need to get the sum per page.
Any ideas how to do that?
You can get page level totals as follows. Create three formula fields in report design, namely ff_Reset_Total
, ff_Current_Total
, ff_Add_Record
and set their values in formula editor as under:
ff_Reset_Total
whileprintingrecords;
numbervar PageTotl;
PageTotl:=0;
ff_Current_Total
whileprintingrecords;
numbervar PageTotl;
PageTotl;
ff_Add_Record
whileprintingrecords;
numbervar PageTotl;
PageTotl:=PageTotl + {TheField};
Now place these formula fields in your report as under:
ff_Reset_Total
in Page Header Sectionff_Current_Total
in Page Footer Sectionff_Add_Record
in your Details SectionNow hide ff_Reset_Total
and ff_Add_Record
by Right Click
on each of them in Page Header and Details Sections, point to Format Field
and then in the Common
tab select Suppress