Image in details

  • 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.

  • 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.

  • Could you tell me how to do that?

  • 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

  • Oh, you meant on the dataase... I meant in the report table...

    I'll try having an image column in my databse table...

    Thanks

  • 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