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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How and where to reset shared variable 1

Status
Not open for further replies.

DianaStewart

Programmer
Apr 16, 2002
58
CA
Subreport:

Group Header1 is grouped by LastName
Group Header2 is grouped by Date (Month)

I have placed my formula is Group Footer2:

whileprintingrecords;
shared numbervar Variable1 := sum({PunchCard}, "monthly")

In my Main Report I have this formula placed in the Group Footer 2:

whileprintingrecords;
shared NumberVar Variable1;
Variable1


The problem is the same value is for the variable is being carried over to each LastName. If Smith has 30 as the shared variable then the value 30 is also being passed onto the next name.

Where and how can I reset the variable for each LastName?
 
Place

WhilePrintingRecords;
Shared NumberVar Variable1 := 0;

in the GroupHeader2.

Naith
 
In which report do I place this Reset? In the main report or the subreport?
 
What are you trying to do?

The shared variable isn't of any use in the main report, until the subreport has finished processing. SO why not have a line in the subreport...
shared numbervar Variable1 :=
Variable1 + sum({PunchCard}, {datefield},"monthly") Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top