Displaying an entity image from Dynamics 365 online in a SSRS FetchXML Report

approach1 contact information

Recently I have tried to export the entity image of multiple records out of the Dynamics 365 online organisation. As everybody knows by now, this is near impossible, unless you write a SRSS FetchXML Report. But you do have to keep some restrictions in mind which are nowhere clearly defined.

My guide… the internet!

The blogpost “How to Display Image from Dynamics CRM Online in SSRS FetchXML Report” guided me in my efforts to export the entity images from the Dynamics organisation into a Word document. The ‘final solution’ offered by  will help you in your efforts, but he fails to mention 2 important restrictions.

The solution by Mahesh:

  1. Attach image to note.

approach2 activities notes

  1. Create dataset in FetchXML to retrieve notes with images.

fetchxml dataset

document body

  1. Drop image control on SSRS report.
  2. Set source as Database.
  3. Set MIME type as per your requirement. (PNG,JPG etc..)

image properties

  1. Deploy and execute report in CRM online.

display image ssrs fetchxml report

Restrictions which are missing in the post

50 KB is the maximum limit!

In Mahesh’ case, he only exported one entity image from the system. In my case, I was trying to exporting multiple entity images (as I was exporting multiple records). This created a problem as some images were exported and others were not. With trial and error my colleague Kevin found out that the images are exported, unless they are bigger than 50 KB ! 49,9 KB does not form a problem, but try exporting 50,1 KB and your image will not show up. Kudos to you Kevin!

MIME type matters or doesn’t it?

Mahesh used a MIME type of image/png. The report builder is very strict about this as you cannot use multiple MIME types and I have not found a workaround for this. It is required of you to pick one type. But strangely enough, I used MIME type image/png, and some image of the type ‘jpg’ also showed. If somebody knows the cause or a solution for this strange behavior, do reach out!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.