Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

What is the best way for toggling between images on a SSRS report?

On the report I'm creating, there are lots of questions with Yes Or No answers and based on the value I've got for the question, I'd like to show the correct image.

For example we have gender:

Famale
Male

This report is for output only and is not going to be used for performing data entry.

For each record I have the value in the column 'Gender' whether the person is male or female. I want to show a square with a tick mark in it next to the correct gender, while keeping the other option box empty (an empty square image). This should function like a radio button.

So if the record has gender = 'Female', I should show a tick image next to Female text box and an empty square next to Male text box and, vice-versa, if gender = 'Male' on the record.

Any suggestions?

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

You can use expressions for this type of conditional work. To do this click on the image and select the properties tab in BIDS. Find the expression button (fx) and click it. Enter something like the below to get what you want:

=Iif(Fields!Gender.Value = "Female", "Female.jpg", "Male.jpg")

This is assuming that you have have set up the images to be available as global resources to your report. If not, replace the image names with the paths to the images etc...

A good reference for expressions is below:

http://msdn.microsoft.com/en-us/library/ms157328.aspx

I hope this helps you.

share|improve this answer
    
Thanks Mr Brownstone :) –  Sky Aug 31 '12 at 10:07
add comment

Set the image URL to be an expression, based on that field.

share|improve this answer
    
An example expression would help explain what you mean for future visitors to this question. –  Max Vernon Sep 5 '12 at 18:56
    
MrBrownstone provided an example before I managed to get back to it. I provided a quick answer from my phone in case Nazila needed something to be going along with in the meantime. –  Rob Farley Sep 5 '12 at 22:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.