How can I load images dynamically i开发者_高级运维n place of cell data in a report in Oracle Application Express?
E.g.
A table has 'Y' and 'N' entries. When I display it as a report, I want to use certain images according to the data in the table. If it's a 'Y', display one image and if it's a 'N', display another image.
You can do this:
select id,
htf.img (case when flag='Y' then 'yesicon.png'
else 'noicon.png' end) flag_icon
from mytable
where ...
You probably need to add a path for the filenames e.g. '#WORKSPACE_IMAGES#yesicon.png' etc.
If you will be using this a lot it would be worth building a function to simplify it:
select id,
mypkg.yesno_icon (flag) flag_icon
from mytable
where ...
精彩评论