Up until now I’ve been talking about data and code that generates it with Data Methods . In this post, I’ll show you how to put images into your reports.

First let’s get an image. 

I found one of the sample Windows 7 pictures and made it smaller

image

and then placed that image on my My Pictures folder on the SSRS server.

image

Now lets go back into Visual Studio. I have a simple report defined that renders a table.

image

The report looks like this when previewed …

image

 

Now let’s just add an image to the report by selecting the Images node and clicking Add Image

image

An Image was created called “Image1” – Just rename this to flowers

image

image

And examine its properties

image

Now we need to select the flowers.png file. How? It isn’t obvious at all – you need to click on the field called Base64 Data

image

And then select a suitable bitmap

image

And now you’ll see that the bitmap is loaded into the report.

image

At this point you are expecting me to somehow drag this image into the report or use it as the background of some thing on the page – but that’s not possible. Auto Design reports  weren’t created to let you put things like images on a page. We need to move into the more complicated world of Precision Design reports.

Fortunately, our work on the original report is NOT wasted. We can transform the Auto Design into a Precision design very easily.

Just right-click on the Auto Design and select Create Precision Design

image 

This will create keep the existing Auto Design but create a new Precision design that is an exact copy of the Auto Design…

image

And if you preview it …

image

You’ll see, that it does indeed look exactly like the original AutoDesign – it even has “AutoDesign1” as the title.

image

The Precision design editing experience is much different though. We can access it by double-clicking on the precision design or right-clicking it and selecting Edit Using Designer

 

image

And now we see the Precision Design editing surface. As you can guess, now that we have a surface we can place report elements exactly where we want them. We get exact control over placement but at the cost of simplicity.

image

There’s nothing in the UI that shows what we can put on the surface yet. So, from the View menu select Toolbox

image

And now a list of report elements is available for you to use

image

Click and hold down on the Image element in the Toolbox

image

And drag it onto the white area of the Precision Design

image

This will leave a tiny icon there. The red x icon appears because we haven’t selected a valid image yet.

image

With the image selected, look at the properties window. The Source property is set to External.

image

Because we added (embedded) the flowers.png file to the report change the Source property to Embedded.

image

And then expand the Value property and pick “Flowers”

image

Even without previewing it, you’ll see the flowers show up in the design surface

image

And naturally this works when previewed …

image

KOALAS

What if the image isn’t embedded but is sitting somewhere else – for example on the IIS server that is on the same box as the SSRS server. In this case, I placed kkoalas.png into an folder in the default web site.

image

And validated that I can see the picture when browsing the website with IE.

image

Now go back to the properties for the image we put on the report

image

And set the Source to External

 image

And click on the Value property

image 

Which lets you type into the field directly

image

And enter the url … http://isotopex/images/koala.png

 

image  

And then the design surface will update … to have 100% more Koala

 image

And this is visible in preview, of course

 

image

In this Koala example, the bitmap was on the same server as the SSRS server, we can also point SSRS at images on remote machines

 

Go to the microsoft website …

image

Find an image you want, and right-lick to see its properties

image

image

And you can see the URL there in the Properties dialog

image

Select the text, right-click, and choose Copy

image

Go back to your report …

image 

And change the Value property  …

image

To the new URL …

image

And there you go …

image

NOTE: To fetch images remotely requires that the SSRS Execution account be set correctly (Adding an Image to a Report)