• Post category:BI Publisher
  • Post comments:5 Comments
  • Post last modified:January 27, 2021
  • Reading time:5 mins read
You are currently viewing Display Person Image on BI Report
Display Person Image on BI Report

In this article we will look into adding the Person Image to BI Report.

Want to learn Fusion Technical tools? Checkout this article

Some of the clients want to create user friendly reports with employee images and use the bursting feature to address it to employees on Birthday’s or anniversaries. Some of the clients display the complete profile information of an employee along with the employee photo.

let’s create a simple Report to have the employee picture displayed on the output.

Employee images get stored in PER_IMAGES in BLOB field and the image can’t been seen as such in the data model.

SQL Query to get the images information from PER_IMAGES table:

SELECT A.PERSON_NUMBER,
B.DISPLAY_NAME,
C.IMAGE
FROM PER_ALL_PEOPLE_F A,
PER_PERSON_NAMES_F B,
PER_IMAGES C
WHERE A.PERSON_ID = B.PERSON_ID
AND B.NAME_TYPE='GLOBAL'
AND A.PERSON_ID = C.PERSON_ID

When you run this SQL Query in the Data Model, you will get the output like below:

Person Image Data Model 1024x449 - Display Person Image on BI Report
Person Images Query Result

Now click on export to download the xml file and create a BI template with these fields.

Once you add all the fields into the template using the Table Wizard, the XML tag for the Image field will look as below:

default template - Display Person Image on BI Report
Default tag for Image field will be <?IMAGE?>

With this template, we will get the BLOB output that we saw on the data model screen only. However our requirement is to capture the employee image on the Output and not this BLOB output.

Let’s update the tag for this IMAGE field to:

<?if:IMAGE!=' '?> 
<fo:instream-foreign-object content-type="image/jpg" height="1 in" width="1 in"><?IMAGE?></fo:instream-foreign-object>   
<?end if?>

This code will convert the BLOB text to image.

image - Display Person Image on BI Report
Modified Code for IMAGE

Just double click IMAGE filed.. go to Advanced tab and copy paste the above code and click OK. Save the template and upload it to BI Report.

Final output would be like below:

output 1 - Display Person Image on BI Report
Person Images Output

However if the employee count is huge and you try to run the report for all employees at once, you might get an error that “Report data size (2667550510 bytes) exceeds the maximum limit (2147483648 bytes). Stopped processing.” In such cases add some filters by Legal Entity, Business Unit, Department, Job etc to get your requirement achieved.

Tip: We can use the same approach for any BI Report which needs to use Person Images on the output. There are some settings in the code that you can change to change the height and width of the image that is being displayed.

  • hi Sricharan, Nice stuff, as always.

    If anyone would like to get the same within OTBI, these are the steps:

    1) Create a dummy column
    2) Edit its formula https:///hcmUI/personImage?personId=
    3) Embed person_id from Worker folder
    4) Select html under Data Format and paste the URL

    The only disadvantage, images displayed cannot exported.
    Thanks,
    Santosh

  • Sure.. Will post a new article on it when i get some time.. Most of the viewers don’t check the article they have seen, so it might go unnoticed if i update the existing article.

  • Very helpful information sricharan..Thank you so much posting this kind of articles..

    Please post some articles about HDL..

  • In visible box by plugintheme