Display an image based on boolean expression

  • I embed an image in the background properties of sql server reporting services. I would like to manipulate the image using an If statement but a I am not sure about the correct syntax to use. See example below:

    IIF(Fields!InvoiceID.Value like "ET*", "watermark.bmp",

    IIF(Fields!InvoiceID.Value like "GT*", "watermark.bmp", Nothing))

    I would like this expression to be a wildcard search to find the first 2 character of InvoiceId (e.g ET098777, GT099456), If the field starts with "ET", or if the field start with "GT", then the image would display based on these two criteria, else don't display the image.

    Any suggestion would be greatly appreciated.

    Thanks,

    leonie6214

  • You can embed the images into your report then you need to write just name of the images in iff statement.

    U can embed the images by clicking report and then embedded images.

  • The image is already embeded in the report. The problem is getting the expression to manipulate the image. I tried the expression listed in my previous post, but the image does not display based on the condition. I need to modify the expression with the correct syntax.

  • I don't think that "like" can be used. Why not Left(xxx, 2) in your example ?

    =IF(Left(MyField,2)="ET";"Mybitmap.bmp";"")

    Christophe

  • Christophe,

    I was able to resolve this issue about a week ago using the an expression similar to yours.

    Thanks for responding.

    leonie6214

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply