How do I show an approver's name in a report?
To show an employee's approver in a report, the report has to meet a few initial conditions:
- The report must be a custom report.
- The report must be a custom report that includes the employee as a reporting column.
- Examples include timesheet details, employee expense details, employee summary reports, or any summary report that includes the employee name as a report column.
To add a reporting column that displays the employee's approver:
- Navigate to Reports.
- Click on the name of the custom report you want to modify.
- Click on Edit.
- Click on the Plus (+) button to create a new report column.
- Scroll down the new reporting column values pick list to the very bottom and select "sql expression."
- Sql expressions are sql statements that can reference system data and produce a calculated value, or can reference system data and produce a value for display in a report column. In this case, we are going to reference a value for display as a text value.
- When you add the sql expression report column for the first time, a sql expression dialog will pop up for editing. Later, you can edit this sql expression by clicking on the sql expression report column field in the reporting setup page.
- In the sql expression dialog, enter the following sql statement: select uu.fullname from t_user as uu where uu.id=t_user.apprv1id
- Set data type to 'Text'.
- If your system is using a SQL Server database, you will need to include t_user.apprv1id in the "group by" expression for a summary report by appending: ,t_user.apprv1id
- In this example, the part of the statement with t_user.approv1id will display the level 1 approver name. If you want to show other approver levels, just modify the statement to reference that level number, e.g. t_user.approv2id, t_user.approv3id, etc.
- Edit the sql expression report column name, modifying it to approval level name, e.g. manager approver, supervisor approver, etc.
- Click Okay to save the report.
- If you want, you can repeat the process and create additional report columns that display other approval level names.