I want to get an employee's name to show up on an employee productivity report. Currently, only the employee ID does. Since the ID gets there via vars, calc's & filters, getting the employee name is a bit more complicated than I first thought. Here's some info re: the employees table, the reports menu and the report that may help clarify this.
the Employees table has 5 fields
emp_id > c6
first_name > c20
mi > c1
last_name > c25
The Reports menu allows the user to set various vars, including Empl_ID (it's done with an array/picklist that displays all of the employees). Date ranges, which plant and other vars get set here too.
Note the diff between the table field name of 'emp_id' and var name 'empl_id' as the translation between the 2 can be confusing if you haven't paid attention to their difference.
The productivity report uses a variety of calc's and vars to filter the report and to display just what filters are in effect
When the 'Employee Productivity' button gets pushed a report that shows everything the employee did during the date range that was chosen is printed. It shows the employee ID, desc. of operations done, what job number, how much time the employeed billed for the operation, if there is any piece work it gets calc'ed to a per/hr amt, etc.).
The filter for the report looks like this:
Bill_Date>=VAR->BEGIN_DATE.AND.Bill_DateEnd_Date.AND.*any(Press_Costs->Emp_Id,Var->Empl_id).AND.*any(Press_Costs->Oper_Id,Var->press_id).AND.*any(Press_Costs->Op_Type,Var->Mwr).OR.*any(Bind_Costs->Emp_Id,Var->Empl_id).AND.*any(Bind_Costs->Oper_Id,Var->bind_id).AND.*any(Bind_Costs->Op_Type,Var->Mwr).OR.*any(Comp_Costs->Emp_Id,Var->Empl_id).AND.*any(Comp_Costs->Oper_Id,Var->comp_id)
Translated, it means "show me any press operations, any bindery operations, and any composition operations done by this employee for any jobs that were billed on a date that was equal to or greater that the Beginning date chosen in the Reports Menu and equal to or less than the Ending date also chosen in the Reports Menu (there are a couple of other filters there too but they don't affect this).
All of the data that gets printed is in a Subreport region and the report title & headings are in the Report Header. I'd like to get the Employees's name up in this Report Header too. Currently, there is a report criteria string up there that displays what the report is based on & I'd like to put the name in that string. Here's what this looks like (it's a calc'ed string named 'report_criteria_e'): "Report based on: Employee "+Calc->employid+", Press Op = "+calc->pressid+", Bind Op = "+calc->bindid+", Comp Op = "+calc->compid+"& Op Type = "+calc->m_w_r. When it prints it'll display something like this: "Report based on: Employee E005, Press Op = All Press Ops, Bind Op = All Bindery Ops, Comp Op = All Composition Ops and Op Type = RUN." I'd like to get it to display like this: "Report based on: Employee = Joe Jones, Press Op = All Press..."
The calc->employid is this: if(var->empl_id="","All Employees",var->empl_id). If the empl_id var does not get set then the report is based on all employees so this little bit just makes sure the criteria string says 'All Employees' rather than nothing.
I think I need to build another calc that concatenates the first & last_ name fields together and then somehow tie the table field->emp_id back to the var->empl_id so that the correct name shows up. But I'm getting lost in the complexity of all of this, so any ideas sure would be appreciated.
Bill
the Employees table has 5 fields
emp_id > c6
first_name > c20
mi > c1
last_name > c25
The Reports menu allows the user to set various vars, including Empl_ID (it's done with an array/picklist that displays all of the employees). Date ranges, which plant and other vars get set here too.
Note the diff between the table field name of 'emp_id' and var name 'empl_id' as the translation between the 2 can be confusing if you haven't paid attention to their difference.
The productivity report uses a variety of calc's and vars to filter the report and to display just what filters are in effect
When the 'Employee Productivity' button gets pushed a report that shows everything the employee did during the date range that was chosen is printed. It shows the employee ID, desc. of operations done, what job number, how much time the employeed billed for the operation, if there is any piece work it gets calc'ed to a per/hr amt, etc.).
The filter for the report looks like this:
Bill_Date>=VAR->BEGIN_DATE.AND.Bill_DateEnd_Date.AND.*any(Press_Costs->Emp_Id,Var->Empl_id).AND.*any(Press_Costs->Oper_Id,Var->press_id).AND.*any(Press_Costs->Op_Type,Var->Mwr).OR.*any(Bind_Costs->Emp_Id,Var->Empl_id).AND.*any(Bind_Costs->Oper_Id,Var->bind_id).AND.*any(Bind_Costs->Op_Type,Var->Mwr).OR.*any(Comp_Costs->Emp_Id,Var->Empl_id).AND.*any(Comp_Costs->Oper_Id,Var->comp_id)
Translated, it means "show me any press operations, any bindery operations, and any composition operations done by this employee for any jobs that were billed on a date that was equal to or greater that the Beginning date chosen in the Reports Menu and equal to or less than the Ending date also chosen in the Reports Menu (there are a couple of other filters there too but they don't affect this).
All of the data that gets printed is in a Subreport region and the report title & headings are in the Report Header. I'd like to get the Employees's name up in this Report Header too. Currently, there is a report criteria string up there that displays what the report is based on & I'd like to put the name in that string. Here's what this looks like (it's a calc'ed string named 'report_criteria_e'): "Report based on: Employee "+Calc->employid+", Press Op = "+calc->pressid+", Bind Op = "+calc->bindid+", Comp Op = "+calc->compid+"& Op Type = "+calc->m_w_r. When it prints it'll display something like this: "Report based on: Employee E005, Press Op = All Press Ops, Bind Op = All Bindery Ops, Comp Op = All Composition Ops and Op Type = RUN." I'd like to get it to display like this: "Report based on: Employee = Joe Jones, Press Op = All Press..."
The calc->employid is this: if(var->empl_id="","All Employees",var->empl_id). If the empl_id var does not get set then the report is based on all employees so this little bit just makes sure the criteria string says 'All Employees' rather than nothing.
I think I need to build another calc that concatenates the first & last_ name fields together and then somehow tie the table field->emp_id back to the var->empl_id so that the correct name shows up. But I'm getting lost in the complexity of all of this, so any ideas sure would be appreciated.
Bill
Comment