Exercise: Include dynamic images using custom assembly

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

The answer to the exercise will be included and explained if you attend the Wise Owl course listed below!

Category ==> SSRS Reporting Services  (53 exercises)
Topic ==> Basic Custom Assemblies  (2 exercises)
Level ==> Relatively easy
Course ==> Advanced SSRS
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

This exercise isn't as scary as the title above makes it sound!  The idea is to display an image next to each film, according to whether it's short (under 2 hours), medium (2-3 hours) or long (3 hours +).

Images showing film length

This person clearly isn't a film buff: the shorter the film the better. 


Thoughts on how to go about doing this are shown overleaf!

To start our report off, first add 3 images from the folder shown at the start of this exercise into a new report called Not a film buff:

Adding images

Right-click on the Images category, and choose to add 3 images from the folder shown at the start of this exercise (they've got PNG extensions).

Now create a report listing out the names and lengths of films, with an image showing that each film is great:

Initial report including image

Write a function in a class library, build it and copy the DLL over so that it is available to you in your report server project.  Here's what the function should return:

Length of film  (minutes) Image returned
Up to 120 great
120 to 180 ok
More than 180 yawn

You can write your code for the custom assembly using either VB or C# - the choice is yours!

Set this function to be the source for your image:

Image source

Click on the expression builder tool to set the source for this image to be the results of your function.


Check that your images look correct in your report!

This page has 0 threads Add post