Monday, November 17, 2014

SSRS Embedded Images Best Practices

Josh,

So you want to use some images in an SSRS report, keep these tips in mind to ensure they look great!

Image Type

Typically, it seems best to use .jpg images as they appear to look good in BIDS, SharePoint, and exported to a PDF.  Here are some key comparisons between .jpg and .png:


item .jpg .png
Looks good in BIDS / Visual Studio Yes Yes
Looks good in SharePoint / Reporting Services Yes Yes
Looks good exported to PDF Yes No
Handles Transparency No Yes


Image Size

You will want the image to be as close to the rendered size as possible.  Using a larger image may cause pixelation when rendered to a smaller size on SharePoint / Reporting Services / PDF.  Obviously using a smaller image expanded will cause the same issue.

Dynamically select an Embedded image

  1. Add images to Images folder in the Report Data pane

  2. Add the image object to the tablix field

  3. Right-click the newly added image field and select "Image Properties"
  4. "Select the image source" should be set to Embedded and select the "fx" icon to bring up the Expression window
  5. Use the IIF or Switch functions to choose the appropriate image
Expression Example:
=Switch(
Fields!Target_Status.Value = "On Target", "StopLight_Green",
Fields!Target_Status.Value = "Undetermined", "StopLight_Yellow",
Fields!Target_Status.Value = "Off Target", "StopLight_Red"
)

No comments:

Post a Comment

Please only include comments that add to the substance of the Blog Post:
- Question or request for clarification
- Idea for improvement
- Identifying an issue

Please refrain from promotion.