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

Suppress group header based on group footer field? 1

Status
Not open for further replies.

jrayne

Technical User
Jul 9, 2004
3
US
I'm working w/CR 9.0 based off an Oracle database.

I have 4 groups:
1. Department {WORKORDERS.DEPARTMENT}
2. Job Number {WORKORDERS.WORKORDERNUMBER}
3. Labor Date {WORKORDERLABOR.DATE}
4. Person {WORKORDERLABOR.PERFORMEDBY}

Detail section is suppressed but contains labor times for each person. A formula field is used evaluate the kind of hours worked {WORKODERLABOR.TOTALTIME} based on the billing {WORKORDERLABOR.REGULARBILLING}.
//{@RegularHours}
If {WORKORDERLABOR.REGULARBILLING} = 1 then {WORKORDERLABOR.TOTALTIME} else 0

In GF4: Using a formula field I summed the hours worked for each person and returned only those values greater than 8.0, otherwise the field returns 0.0.
//{@Daily Regular Overtime Summary}
If (Sum ({@RegularHours}, {WORKORDERLABOR.PERFORMEDBY})) > 8.0
Then (Sum ({@RegularHours}, {WORKORDERLABOR.PERFORMEDBY}) - 8.0)
Else 0.0

In GF3 I summed the accumulated totals in GF4 by using the 3 formula method:
//Placed in GH3 {reset}
WhilePrintingRecords;
Numbervar DailyRegOTSum := 0;

//Placed in GF4 {accum}
WhilePrintingRecords;
Numbervar DailyRegOTSum := DailyRegOTSum + (If (Sum ({@RegularHours}, {WORKORDERLABOR.PERFORMEDBY})) > 8.0
Then (Sum ({@RegularHours}, {WORKORDERLABOR.PERFORMEDBY}) - 8.0)
Else 0.0);

//Place in GF3 {display}
WhilePrintingRecords;
Numbervar DailyRegOTSum;

That all works fine and when {display} in GF3 is zero I suppress the footer.
//suppress x+2
{@display} = 0.00

I'd like to also suppress GH3 when {display} is zero.
I tried using the same formula in the suppress section of GH3 {display} = 0.0 but it doesn't work proplerly. Any help is appreciated.

Thanks, JR



 
You can't suppress the header based on a result that won't be known until the group detail lines need to be printed.

The only work-round I can see would be to do the same sum in a subreport which you would place in a dummy group-header line, using Shared Variables to return the result and using it to suppress the next section. Inefficient, of course

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
I was afraid that would be the only solution.
Thanks for the timely response.
-JR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top