Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to set a default image

Hi all,

I want to display profile picture of employees when I select the Employee name from a list box. But for some employees there is no image available in the database. For such employees I want to display a default image. How can I do this? Please help me on this.

Thank You!



1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

In your loading script you must be loading a mapping table for employee and the path\filename for employee picture. If so, you may add if condition in your load script to find if employee picture exists and load that, otherwise you can load a default image - image not available or something.

So briefly:

LOAD EmpName,

if(FileTime('c:\images\' & EmpName & '.jpg') > 0, 'c:\images\' & EmpName & '.jpg', 'c:\images\' & 'defualt.jpg') as EmpImage,

….

….

FROM ….

WHERE…

Hope this helps.


View solution in original post

2 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

In your loading script you must be loading a mapping table for employee and the path\filename for employee picture. If so, you may add if condition in your load script to find if employee picture exists and load that, otherwise you can load a default image - image not available or something.

So briefly:

LOAD EmpName,

if(FileTime('c:\images\' & EmpName & '.jpg') > 0, 'c:\images\' & EmpName & '.jpg', 'c:\images\' & 'defualt.jpg') as EmpImage,

….

….

FROM ….

WHERE…

Hope this helps.


Not applicable
Author

Thanks a lot Rakesh... It works fine 🙂