(Updated) Unfortunately, you can't put summary items into page headers / footers in Crystal.
To get round this, you need to use Crystal variables inside Crystal formulas.
To set up running totals of columns on the page:
(1) Create a formula (called something like initiate
) to set the totals to 0, with the following code:
WhilePrintingRecords;
global numberVar tot1;
global numberVar tot2;
tot1 := 0;
tot2 := 0
Include one variable for each column you wish to sum. Add this formula to your page header section, and set it to be suppressed.
(2) Create a formula (called something like iterate
) to add column values to each total, similar to the following code:
WhilePrintingRecords;
global numbervar tot1;
global numbervar tot2;
tot1 := tot1+{table.Field1};
tot2 := tot2+{table.Field2}
Add this formula to your details section, and set it to be suppressed.
(3) Create a formula (called something like display1
, display2
, etc) for each total to display the total, similar to the following code:
WhilePrintingRecords;
global numbervar tot1;
tot1 := tot1+0
Add these formulas to your page footer section (not set to be suppressed).