Skip to main content



      Home
Home » Archived » BIRT » How to change image based on row value?
How to change image based on row value? [message #222964] Wed, 07 March 2007 17:47 Go to next message
Eclipse UserFriend
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!
NEVERMIND - How to change image based on row value? [message #222989 is a reply to message #222964] Wed, 07 March 2007 19:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eric.garrett.sybase.com

I got it figured out...

used Text from palette and then coded up HTML type as:

<IMG src="

<VALUE-OF>

if ((row["type"] == "ASE") && (row["state"] == "Active")){

"/WebReport/images/aseicon.gif"

}

else if ((row["type"] == "Replication Server") && (row["state"] ==
"Active")) {

"/WebReport/images/rsicon.gif"

}

else if ((row["type"] == "Replication Server") && (row["state"] ==
"Suspect")) {

"/WebReport/images/rsinfoicon.gif"

}

else if (row["type"] == "Replication Agent") {

"/WebReport/images/raicon.gif"

}

</VALUE-OF>

" alt="" >







"Eric Garrett" <eric.garrett@sybase.com> wrote in message
news:esnfdc$mp1$1@utils.eclipse.org...
> 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 #223037 is a reply to message #222964] Wed, 07 March 2007 20:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

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
Re: How to change image based on row value? [message #223176 is a reply to message #223037] Thu, 08 March 2007 09:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eric.garrett.sybase.com

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
Re: How to change image based on row value? [message #223915 is a reply to message #223176] Fri, 09 March 2007 18:29 Go to previous message
Eclipse UserFriend
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
Previous Topic:Path to libraries in the report design.
Next Topic:Problem with frameset viewer in iframe and Firefox
Goto Forum:
  


Current Time: Wed Nov 05 14:37:26 EST 2025

Powered by FUDForum. Page generated in 0.03798 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top