Showing posts with label picture. Show all posts
Showing posts with label picture. Show all posts

Sunday, October 12, 2025

Mass export employee photos

Recently was trying to figure out how to mass download/export employee photos from PeopleSoft and followingis what I came up with. It works but the exported image quality is not that great. We are using the delivered application engine HR_EMPLPHOTO to mass import picutes in. The photos are loaded to PS_EMPL_PHOTO table and it creates four photo sizes - CARD, LIST, ORCH and PAGE. The CARD one is the best in terms of picture quality.

The basic idea is to read this table and write the contents to a file. Based on the upload process I know that the picture file format is JPG. The raw image data is stored in the EMPLOYEE_PHOTO field, but we cannot just select this field. I am looping through the employee population, fetching the data and storing it in the record object and then using the WriteRaw method of the File class to write the image to a file. 


Local string &emplid, &filename;
Local Record &imageRec;
Local SQL &imageSQL;

&imageRec = CreateRecord(Record.EMPL_PHOTO);
&imageSQL = CreateSQL("SELECT EMPLID, PHOTO_SIZENAME, PHOTO_IMGNAME, EMPLOYEE_PHOTO, PSIMAGEVER FROM PS_EMPL_PHOTO WHERE EMPLID = :1 AND PHOTO_SIZENAME = 'CARD'", &emplid);

If &imageSQL.Fetch(&imageRec) Then
   &imageFile = GetFile(&filename, "W", %FilePath_Absolute);
   &imageFile.WriteRaw(&imageRec.EMPLOYEE_PHOTO.Value);
   &imageFile.Close();
End-If;

Sunday, February 6, 2022

Displaying/exporting PeopleSoft image/picture files

There isn't a good way to display/export images or picture files deliverd by PeopleSoft. Some smaller images can be viewed via Application Designer but not the ones that are used on fluid tiles. So wrote this small routine to view the images online as well as create a file with the same information which can be shared with the team.

For this POC running PT 8.58.x, HCM 9.2

Created a SQL object N_IMAGES_SQL, selecting image name and version from the PSCONTDEFN table. Selecting only SVG files as those are the ones generally used on fluid tiles. 











Created a page and added a long field of the type HTML Area to the page. 

N_TEST_WRK.HTMLAREA in the code below is that field.

So displaying the images returned by the SQL on the online page along with the image name. When this happens the images are also written to the web server cache folder. So created another string with path to the physical files in the web server cache folder and created an html file. Via a browser opened this html file and saved it as a pdf which can now be shared with the team.   

Complete peoplecode below




Output