| How to change image based on row value? [message #222964] |
Wed, 07 March 2007 17:47  |
Eclipse User |
|
|
|
Originally posted by: eric.garrett.sybase.com
I've got some images in a directory and I'd like to know how I can insert an
image into a column of my table based on a value in another column of that
row? or in other words, if column value is 'success' then I'd like a smiley
face image to be shown and if the column value is 'failure', I'd like to sad
face. From the palette, I dragged the image icon over to my table cell and
chose URI and expression builder and coded the following:
if (row["status"]=="success"){
"file:///c:/images/smiley.gif"
}
else {
"file:///c:/images/sad.gif"
}
I get the following error:
org.eclipse.birt.report.service.api.ReportServiceException: Error happened
while running the report
I would think there is a way to dynamically serve up an image based on
another column value.
Any help would be greatly appreciated, as I'm out of ideas.
Thanks!
|
|
|
|
|
|
| Re: How to change image based on row value? [message #223915 is a reply to message #223176] |
Fri, 09 March 2007 18:29  |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Eric Garrett wrote:
> I'm using 2.1.1.v2006092*. Was this a known bug that has been fixed?
>
> Thanks,
> Eric.
>
>
>
> "Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
> news:esno97$vib$1@utils.eclipse.org...
>> Eric Garrett wrote:
>>> I've got some images in a directory and I'd like to know how I can insert
>>> an image into a column of my table based on a value in another column of
>>> that row? or in other words, if column value is 'success' then I'd like
>>> a smiley face image to be shown and if the column value is 'failure', I'd
>>> like to sad face. From the palette, I dragged the image icon over to my
>>> table cell and chose URI and expression builder and coded the following:
>>>
>>> if (row["status"]=="success"){
>>> "file:///c:/images/smiley.gif"
>>> }
>>> else {
>>> "file:///c:/images/sad.gif"
>>> }
>>>
>>> I get the following error:
>>>
>>> org.eclipse.birt.report.service.api.ReportServiceException: Error
>>> happened while running the report
>>>
>>> I would think there is a way to dynamically serve up an image based on
>>> another column value.
>>>
>>> Any help would be greatly appreciated, as I'm out of ideas.
>>>
>>> Thanks!
>> What version of Birt are you using?
>> I just did this expression in 2.1.2 and it works.
>> if(row["PRODUCTCODE"] == "S18_2248"){
>> "file:///c:/temp/down.jpg"
>> }else{
>> "file:///c:/temp/up.jpg"
>> }
>>
>> Jason
>
>
I thought this was a bug, but I thought it was fixed before 2.1.1.
Jason
|
|
|
Powered by
FUDForum. Page generated in 0.04235 seconds