Display Image in SSRS Report

In this article, we will show you how to display Image in SSRS Report. It is one of the standard requirements while you are designing a report because every client needs their logo to display in the rendered report. So, here we will show you the step by step approach to view image in SSRS Report with an example.

To explain the images in SSRS Report, we use the below-shown DataSet. Please refer to Embedded Data Source and Dataset articles in SSRS.

Display Image in SSRS Report 2

And the Custom SQL query that we used in the above Dataset is:

-- Displaying Image on SSRS Report
USE [AdventureWorksDW2014]
GO
SELECT [FirstName] + ' ' + [LastName] AS [FullName]
      ,[EmailAddress]
      ,[Gender]
      ,[Title]
      ,SUM(FACT.SalesAmount) AS SalesAmount
      ,SUM(FACT.TotalProductCost) AS ProductCost
      ,[EmployeePhoto]
  FROM [DimEmployee] AS EMP
  INNER JOIN [FactResellerSales] AS FACT ON
  EMP.EmployeeKey = FACT.EmployeeKey
  GROUP BY [FirstName]
      ,[LastName]
      ,[EmailAddress]
      ,[Gender]
      ,[Title]
      ,[EmployeePhoto]

Data written by the above query is:

Display Image in SSRS Report 1

Display Image in SSRS Report

To demonstrate the steps involved to display image in SSRS Report, We are going to use the previously generated report that we shown below. Please refer SSRS Table Report article to understand the steps involved in creating Table Report and refer Format Table Report in the SSRS article to understand the formatting.

Display Image in SSRS Report 3

Let me show you the Report Preview.

Display Image in SSRS Report 4

For the image in SSRS Report demonstration purpose, we will add an Image (our logo) to the Page Header. To do so, right-click on the Page Header and select the Image option from the context menu.

Please refer Add headers and Footer to SSRS Report article for adding Page headers and footers.

Display Image in SSRS Report 5

Once you select an Image option, a new window called Image Properties will be displayed as we shown below.

Under the General tab, we have three options to select the image source:

  • External: This option is useful if you want to display the dynamic Image from coding. Say, you can show the dynamic Image from C#, VB.NET, etc.
  • Embedded: If you want to store the image, and it’s MIME type inside the report definition, then you can use this option. Use this option to avoid any errors because there is no chance to miss the Image because it stores in the report definition.
  • Database: Use this option to display images present in the Database Tables.
Display Image in SSRS Report 6

First, we will explain the Embedded option, and later we will show you the Database option. For this, Please select the Embedded option as the Select the image source option, and click on the Import button to import the image from Local File System to the report definition.

Display Image in SSRS Report 7

Once you click on the Import button, an open dialogue window will be opened to select the image from the file system. Let me select one random image.

Display Image in SSRS Report 8

Click OK to close the properties window

Display Image in SSRS Report 9

From the below screenshot, you can see that the Logo Image is displaying in our report.

Display Image in SSRS Report 10

Use your mouse to adjust the width, ad height of an image as per your requirements.

Display Image in SSRS Report 11

Once you completed with the Image scaling, Click on the preview tab to see the report preview.

Display Image in SSRS Report 12

Image Properties: Right-click on the image will open the context menu. Please select the Image Properties.. option from it to alter the properties of an existing image.

Display Image in SSRS Report 13

Under the Size tab, we have four options to adjust the image display

  • Original Size: This option resizes the Image Item (report Item) to display the image in the original size. For example, if you select the 720p Image then it will accommodate space for 720p and display the Image.
  • Fit to Size: This option will resize the Image to fit inside the Image Item (report Item). For example, if you select a 720p image and the report item size is 100 * 100, then the 720p Image will compress to fit inside that 100 * 100 item.
  • Fit Proportional: This is the default option for an image item. This option will resize an Image to fit inside the Image Item (report Item) while maintaining the aspect ratio.
  • Clip: It clips the Image to fit inside the Image Item (report Item).
Display Image in SSRS Report 14

Padding means an extra space around the Image. Let me add 10pt to the left side of an image

Display Image in SSRS Report 15

Now you can see there is a space on the left side of an image.

Display Image in SSRS Report 16

Under the Visibility tab, you can decide whether you want to show the image, or not.

  • Show: This is the default option. It will show the Image Item
  • Hide: It will hide the Image Item.
  • Show or Hide based on an expression: The report item will be shown based on the expression that we wrote here.
  • Display can be toggled by this report Item: The report item will be shown based on another report item.
Display Image in SSRS Report 17

Under the Action tab, you can enable the action functionality to the image. We already explained these options in Go to URL article, so please refer to the same.

Display Image in SSRS Report 18

You can use the Border tab to change the Border style, Color, Type, width, and pattern. By default, image item doesn’t present any border. For the demonstration purpose, we changed the Presents from None to Outline, Width to 4pt, Color to midnight blue

Display Image in SSRS Report 19

As you can see from the below screenshot, our Image item surrounded by Border of the color that w specified.

Display Image in SSRS Report 20

Display Database Images in SSRS Report

To demonstrate the same, we added an empty column to the existing report. Please select the TextBox, and Right-click on it will open the context menu. Please select the Insert and then Image option.

Display Image in SSRS Report 21

Once you select an Image option, a new window called Image Properties will be displayed.

Here, Please select the Database option as the Select the image source option, and select the Database field that holds the images. As you can see we are selecting the Employee Photo

Display Image in SSRS Report 22

Next, select the MIME type

Display Image in SSRS Report 23

Let me show you the Display Image in SSRS Report preview.

Display Image in SSRS Report 24