mrmookster
Programmer
I am using shared variables in order to calculate subtotals from a subreport as follows.
Group
//Reset subtotal
// reset
whileprintingrecords;
global numbervar Totals :=0;
Detail
//Calculate subtotal
whileprintingrecords;
global numbervar Totals;
shared numbervar missingDays;
Totals := Totals + missingDays;
Group Footer
// display subtotal
whileprintingrecords;
global numbervar Totals;
Totals
The problem occurrs where a group spans multiple pages. The subtotals are reset on each page break so the subtotal shows only the totals for that page.
Group
//Reset subtotal
// reset
whileprintingrecords;
global numbervar Totals :=0;
Detail
//Calculate subtotal
whileprintingrecords;
global numbervar Totals;
shared numbervar missingDays;
Totals := Totals + missingDays;
Group Footer
// display subtotal
whileprintingrecords;
global numbervar Totals;
Totals
The problem occurrs where a group spans multiple pages. The subtotals are reset on each page break so the subtotal shows only the totals for that page.