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!

Sub report - formula, clearing totals

Status
Not open for further replies.

jrcol12357

Programmer
May 9, 2007
39
US
I'm bringing a subreport numbervar and using it in a main report formula. It works fine, I haveing trouble clearing and refiguring for the next group below. I have add section(s) below to clear formula but I can't to get the proper solution for the next group.

SubReport:
whileprintingrecords;
shared numbervar wplabor := if IsNull (Sum({wplabor.laborhrs})) then
0
else Sum ({wplabor.laborhrs})

Main report Formula:
if ({@WorkUnit}) in ['BLDFOR'] then ToNumber("360") - ({@sharedwplabor})else
if ({@WorkUnit}) in ['CARPFOR'] then ToNumber("280") - ({@sharedwplabor})else
if ({@WorkUnit}) in ['ELECFOR'] then ToNumber("900") - ({@sharedwplabor})else 0

Main Report - sharedwplabor.
whileprintingrecords;
shared numbervar wplabor

Main Report: Clear value
whileprintingrecords;
shared numbervar wplabor := 0
 
Please explain in what report sections the subreport and each formula are located.

-LB
 
Subreport:
sharedwplabor is in report footer

Main Report:
Sharedwplabor - (call) is in Group Footer 2

wpclear - I have put in group footer 1 and into new sections below GF2.

Group 1 is a business group ex. "Facilities Maintenance", "Fleet Maintenance"

Group 2 is diffent labor in "Facilities Maintenance"
ex. Carpenter, Painter, Electical....


wpclear - I have put in group footer 1 and into new sections below GP2.
 
The subreport must be in a section ABOVE any formula that is referencing the shared variable from the subreport. I think you need to place the subreport in a GF#2a section, and then reference the shared variable in the GF#2b. The sub should be linked on both group fields. The reset formula should be placed in GH#2. If you then need to total the subreport results for a total in GF#1, you need to use additional variables in the main report.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top