How to dynamically add images under specific condi

Hi all,

I wanna dynamically add images to a cell by validating a condition, my condition is as follows,

Code:
$F{row1} . intValue() == 1 ? 0 : 1</td></tr></tbody></table><br />
<br />
<br />
Now wanna to change this condtion to something like this<br />
<br />
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%"><tbody><tr><td><b>Code:</b></td></tr><tr><td><pre>$F{row1} . intValue() == 1 ? image1 : image2</td></tr></tbody></table><br />
<br />
<br />
How can i achieve it<br />
<br />
Thanx in advance<br />
<br />
-Nithya
nithya's picture
15
Joined: Jul 26 2006 - 11:31pm
Last seen: 16 years 8 months ago

1 Answer:

This one works for me.
Add an image on your report, click properties and then add this formula in tab Image -> Image Expression:
$F{row1} . intValue() == 1 ? "C:\\MyApp\Images\image1.gif":"C:\\MyApp\Images\image2.gif"

Make sure you have image1.gif and image2.gif in above folder.
dprogrammer's picture
Joined: Jul 19 2006 - 7:37am
Last seen: 1 week 4 days ago
Feedback
randomness