October 7, 2005 at 11:24 am
Hello.
I'm trying to have a column in a table with an image in it. I can do that. My problem is that the image I show depends on a value in that row. I'm trying to change the value of the image using a switch... something like this:
=Switch(Fields!intClasificacionId.Value = 1 , Red1, Fields!intClasificacionId.Value = 2, Yellow1, Fields!intClasificacionId.Value = 3 , Green1)
That line of code was the one I put in the value property of both, the background image of the text box and of an image inside the row... I got an error saying: name red1 is not Declared.
To add the images to the report I used embedded images in an image control.
Do you know how to have a conditional image in the details of a report?
Thanks in advance.
October 7, 2005 at 11:34 am
Shouldn't the image be in a separate table.
That allows you to join to that table using a case expression and it follows the normalization rules.
October 7, 2005 at 11:43 am
Could you tell me how to do that?
October 7, 2005 at 11:47 am
Even simpler than that.
Table Images
ImageID
ImagePath (or the image itself)
...
Table
Classification
ClassificationID
ImageID (foreign key to the images table)
...
Then
Select Columns, List, from dbo.Classifications S inner join dbo.Images I on S.ImageID = I.imageID
October 7, 2005 at 11:52 am
Oh, you meant on the dataase... I meant in the report table...
I'll try having an image column in my databse table...
Thanks
October 7, 2005 at 12:02 pm
That's how I'd do it... but maybe there's another way in RS (never worked with that product).
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply