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

Suppress detail field based on group selection 1

Status
Not open for further replies.

maryellc

MIS
Nov 7, 2003
25
US
I have a report that allows the user to select several parameters and then select the group by order either by "Department" or "Employee". If they select by department, I list all employees within that department, who were absent during the parameter date range. A single employee may be in one department and absent multiple days, so I want to suppress their last/first name in the detail if the user selected to group by employee. On both the last and first name fields in the detail section, I have the following suppression formula which is not suppressing:

{@Group By Formula} = "Employee"
or
({TBLEMPLOYEE.LNAME} = previous({TBLEMPLOYEE.LNAME}) and
{TBLEMPLOYEE.FNAME} = previous({TBLEMPLOYEE.FNAME}) and
{TBLEMPLOYEE.MI} = previous({TBLEMPLOYEE.MI}))

If the user selects to group by Department, I don't want to show the department number and description with each employee within the department (detail), so I have this suppression formula which is working:

{?Group by} = "Department" or
({TBLDEPT.DEPTDESC} = previous({TBLDEPT.DEPTDESC}) and
{TBLLABOR.EMPID} = previous({TBLLABOR.EMPID}))

In the group header, I also have suppression formulas on the department number and description as follows, which is working:

{?Group by} = "Employee"

I also have in the group header the following suppression on the employee id and last name/first name:

{?Group by} = "Department"

I can't figure out why my employee last/first names are not suppressing in the detail if the they pass the test 'true' for group by selection = 'employee'. Is this something so obvious that I can't see it from looking at it so long?
 
Since ID is your unique.. for simplicity sake I would use something like:

{@Group By Formula} = "Employee" or
({TBLEMPLOYEE.EMPID} = previous({TBLEMPLOYEE.EMPID})

That may solve your problem (although I don't see what it is)

Lisa
 
I changed the suppression formula on both the last and first name fields within the detail to check for group by = employee or whether employee id = previous employee id -

If there are multiple detail records for the same employee id, the suppression works for all but the first detail line. If there is a single record for the employee, it does not work at all.

I'm stumped.
 
Do you always want to suppress the fields? The formula will only suppress the duplicates.. not the first (or only) line.
 
If the selection to group is by department, I may have the employee listed more than once (for multiple days) and I still want to print the employee name only once. The suppression formula provided works fine for that.

The report results look like this:
(Group) Dept#/Desc
(Detail) EmpID Last Name First Name Date1
Date2
Date3

However, if the selection to group is by employee, the employee id and name will display in the group header and I don't want to see it again in the detail. It is displaying on the first detail line and then suppresses for subsequent same empid.

When grouping by Employee the results look like this:
(Group) EmpID Last Name First Name
(Detail) Dept# EmpID Last Name First Name Date1
Date2
Date3

The report functions - perhaps the 'pretty' needs to take a back burner!
 
Forgive me Lisa...

I went back and deleted the previous suppression formula and did a copy/paste of the formula you provided and it now works no matter which group by I do.

Perhaps there was a mis-placed '(' or ')' that was throwing off my formula.

Thanks again for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top