Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Include image in text
umeshw77
Hi
I have some text elements and want to embed image based on some condition. I am including the code below, this doesn't work.
3. ****<BR>
<BR>
<VALUE-OF>
if (row["****"] == "Male"){
<IMG src="D:Workreportscheckbox-unchecked.bmp">
}
</VALUE-OF>
<BR>
But instead of image, if I provide static text or some row element it seems to work. I am missing something fundamental, but couldn't figure it out. Any help would be appreciated.
Find more posts tagged with
Comments
bhanley
Hi,
Are you selecting a format of HTML for your text control? It is found in a drop-down at the top of the text item editor. Also, you need to make sure the path tot he image is something that can be resolved by the reporting engine at run time. I doubt a Windows file path will be meaningful inside the app server.
Good Luck.
umeshw77
Thanks for the reply. The image location is not a issue, because when I give the same image location outside <VALUE-OF> tag it is getting displayed. My requirement is to display it based on some condition.<br />
<br />
e.g. <br />
<VALUE-OF><br />
if (row["WEIGHT_UNIT"] == "lbs") {<br />
row["WEIGHT"]<br />
}<br />
</VALUE-OF><br />
<br />
Above code displays value of WEIGHT column correctly from data source based on condition. <br />
<br />
Similarly I would like to display image based on condition, e.g. <br />
<VALUE-OF><br />
if (row["****"] == "Female"){<br />
D:Workreportscheckbox-checked.bmp<br />
}<br />
</VALUE-OF><br />
<br />
But this doesn't work, may be wrong syntax or something else. Can I achieve this using some other way, otherwise. The idea is to use expression embedded in static text.
bhanley
Have you tried to escape the path sequence? Like this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'><VALUE-OF>
if (row["****"] == "Female"){
[img]D:Workreportscheckbox-checked.bmp[/img]
}
</VALUE-OF></pre>
umeshw77
Hi Brian
I have tried all possible options including escaping the path, but image just doesn't display. I am sure there is something silly going on, which I am unable to figure out. Any further help would be appreciated, I am stuck at this point and unable to progress with my report work.
Umesh