As most of you must know by now that OTBI is one of the most simple yet one of the most effective reporting tool in Oracle HCM Cloud Application. Apart from being a self-service tool which allows drag and drop feature to create your analysis it also takes care of security features. What this means essentially is that individuals running the report would only have access to records that they are entitled to view (based on the roles assigned to the user). Exactly for this reason at times it becomes necessary to display the current logged in username in the Report.
In this article, we would try to add the Logged in Username field for an OTBI Report.
We would need to have a pre-existing report (say Person Basic Details for this example). The report contains Person Number and Person Name as shown below:
Displaying Current Logged In User
Now for this report we would like to display the Current Logged in User as a header. To accommodate this change we would need to make following changes:
Include a Session Variable which will hold the current session user detail in the OTBI Analysis
Make changes in the associated data model to include this change
Edit the RTF Template to map the new field in the layout
Adding Session Variable to the OTBI Analysis
We need to open the Analysis and under criteria add the session variable as shown:
Once we add the field, we should ‘Save’ the Analysis.
Adding the User Field on the Data Model
Before we add the field to the data model is would appear as shown below:
We need to click on the ‘Edit Data Set’ option and point to the OTBI Analysis as shown:
Once done the Data Model would appear as below (Notice the new column ‘Column2’ is visible now)
Once done we need to save the Data Model.
Adding the New Field in the RTF Layout
As a last step, we would need to add the new field in the RTF Layout. We would need to add the below fields in the Layout
CURRENT LOGGED IN USER
The Modified template would look as:
We need to save this template.
Running the Report
We would now try to run the Report and confirm whether the changes are as expected. We would need to click on the “View Report” Button
And this brings up the below screen
Which now has the Current Logged in User Details displayed?
With this, we have come to the end of the article. Thank You! For your time and have a nice day ahead.