mrmookster
Programmer
I am using shared variables to calculate subtotals passed back from subreports in my main report BUT when a subreport is suppressed (v10) it still upgdtes the running total used to compute subtotals for the main report ... how can i stop the subtotal accumulating (uses last value) if the subreport is suppressed?
In group header
// reset
whileprintingrecords;
shared numbervar missingDays := 0;
global numbervar Totals :=0;
In detail (subreport section)
// accumulate
whileprintingrecords;
global numbervar Totals;
shared numbervar missingDays;
Totals := Totals + missingDays; // evaluates whether subreport printed or not
In group footer
// display subtotal
whileprintingrecords;
global numbervar Totals;
Totals
For example say I have 2 records returned for a particular group, but only one has data in the subreport Total = 20 (ie 10 + 10) it should only be 10
In group header
// reset
whileprintingrecords;
shared numbervar missingDays := 0;
global numbervar Totals :=0;
In detail (subreport section)
// accumulate
whileprintingrecords;
global numbervar Totals;
shared numbervar missingDays;
Totals := Totals + missingDays; // evaluates whether subreport printed or not
In group footer
// display subtotal
whileprintingrecords;
global numbervar Totals;
Totals
For example say I have 2 records returned for a particular group, but only one has data in the subreport Total = 20 (ie 10 + 10) it should only be 10