Adding Images to a SSRS Report (Embedded & Database)

An image is a report item that contains a reference to an image that is stored on the report server, embedded within the report, or stored in a database. An image can be a logo or picture, or it can be a picture that is repeated with rows of data. You can also use an image as a background for certain report items.

When you use a server-based image in a report, the image item contains a path that points to an image on the report server. When you use an embedded image, however, the image data is stored within the report definition and does not exist as a separate file.

Server-based images work well for logos and static pictures that are shared among several reports or Web pages. Embedded images ensure that the images are always available to the report, but they cannot be shared. Report definitions with server-based images are smaller than definitions with embedded images.

Data-bound images can also be displayed from binary data stored in a database. For example, the pictures that appear alongside product names in a product list are database images.

Making an image available to a report is not the same as adding it to the report layout. To add an image to a report, drag the Image report item from the Toolbox to the report. Use the Image Properties dialog box to control the way the image renders in the report.

To add an image
  1. In Design view, click Image in the Toolbox.
  2. Click a location on the design surface and drag the mouse to create a box that is the size of the desired image. Alternatively, click the design surface to create an image item of fixed size.
  3. In the General page of the Image Properties dialog box, type a name in the Name text box or accept the default.
  4. (Optional) In the Tooltip text box, type text to display when the user hovers the mouse over the image in a report rendered for HTML.
  5. In Select the image source, click the option that specifies where the source for the image exists.
    1. External   Choose this option when you specify an image that exists on the report server or on a Web server. For this option, you must type a URL to the image or select a dataset field that contains a URL to the image.
    2. Embedded   Choose this option when you specify an image that is part of the report definition.
    3. Database   Choose this option when you specify a dataset field that is bound to a database field that contains an image
  6. Click OK.
  7. (Optional) Click Size, Visibility, Action, or Border to set additional properties for the image report item.
Embedding Images

You can embed images in a report so that all image data is stored within the report definition. When you embed an image, Report Designer MIME-encodes the image and stores it as text in the report definition. Using an embedded image ensures that the image is always available to the report, but it also increases the size of the report definition.

To embed an image in a report
  1. In Design view, in the Report Data pane, right-click the Images node, and then click Add Image.
  2. In the Image Properties dialog box, type the name in the Name text box or accept the default.
  3. In the ToolTip text box, type a tooltip that you want to appear when the user hovers a mouse over the image in the rendered report.
  4. In Select the image source, select Embedded from the drop-down list.
  5. In the Use this image text box, type the path to the image file.
    Alternatively, click Import, navigate to the file, and then click Open. In Files of type, select the image file type, select the file, and then click Open. Click OK.
    The file is displayed under the Images folder in the Report Data pane.
  6. To add the image to the report, drag the image from the Report Data pane to the design surface. The Image Properties dialog box opens.
  7. Click OK.
External Images

You can include stored images in a report by specifying a URL to the image. When you use an external image in a report, the image source is set to External and the value for the image is the URL address to the image. For a report published to a report server configured for native mode, use a full or relative path.

For example, http://<servername>/images/image1.jpg.

For a report published to a report server configured in SharePoint integrated mode, use a fully qualified URL.

For example, http://<SharePointservername>/<site>/Documents/images/image1.jpg.

Background Images

You can use an image as a background image in the body of the report or in a rectangle, text box, list, matrix, or table. A background image has similar properties as an image. You can also specify how the image is repeated to fill the background of the item.

Data-bound Images

You can add images that are stored in a database to your report. You use the same Image report item as the one used for static images, but with a set of properties that indicate that the image is stored in a database.

To add a data-bound image
  1. In Design view, click Image in the Toolbox.
  2. On the design surface, click the design surface and then drag the mouse to create a box that is the size of the desired image. Alternatively, click the design surface to create an image item of fixed size.
  3. In the Image Properties dialog box type a name in the Name text box, or accept the default.
  4. (Optional) In the Tooltip text box, type text to display when the user hovers the mouse over the image in the rendered report.
  5. In Select the image source, select Database.
  6. In Use this Field, select the field that contains the image.
  7. In Use this MIME type, select the MIME type of the image.
  8. Click OK.
An image placeholder appears on the report design surface.