Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared variables subtotals resetting on page break

Status
Not open for further replies.

mrmookster

Programmer
Feb 8, 2005
27
GB
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.

 
Sorrt neglected to mention... using Crystal Reports v10.

Subreport contained in the detail section.
 
Change yuor reset formula to

// reset
whileprintingrecords;
global numbervar Totals;

if not inrepeatedgroupheader then
Totals :=0;

HTH





Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top