How to dynamically add images under specific condi

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

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
7
Joined: Jul 26 2006 - 11:31pm
Last seen: 15 years 11 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 month 2 weeks ago
Feedback