web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

SSRS - Display Image in a report from an Image column Type

(0) ShareShare
ReportReport
Posted on by 903

Hello,

I have a custom table in dataverse that has an Image column as a data type. I created one record for this table and uploaded a png image.

pastedimage1660075114452v1.png

I started building the SSRS Report that is linked to that table to display the image uploaded.

Below is the issue that I am facing:

It seems that the Image column type in dataverse does not save the content of the image as base64 and to display the image in the report requires this content.

Do I have to create a "Text Area" field hidden to convert the uploaded image to base64 and make the report rely on this field? If so, how can we do it via plugins?

Can please someone provide an example of how can we convert the image to base64, set the results in the text area field using the plugin, and when the plugin should be triggered?

Any help is highly appreciated.

Best regards,

EBMRay

I have the same question (0)
  • Suggested answer
    JasonMcandrew Profile Picture
    40 on at
    RE: SSRS - Display Image in a report from an Image column Type

    Thanks for your help with this, I've been looking to implement product images in our quote report.

    My findings were that the EntityImage column is in fact Base64 encoded already. The problem is the data type "Image" is not supported when adding EntityImage in the FetchXML of my Dataset in Visual Studio.

    I created a new text column and used a simple flow to copy the value from EntityImage into the new column. I can now include the text column in my report using the method System.Convert.FromBase64String() which is working perfectly.

  • EBMRay Profile Picture
    903 on at
    RE: SSRS - Display Image in a report from an Image column Type

    Hello  ,

    Thank you so much for spending your time and providing a detailed step-by-step to achieve this requirement.

    I will follow your steps and get back to you if I encounter any issues.

    Your help is greatly appreciated!!

    Best regards,
    EBMRay

  • Verified answer
    Community Member Profile Picture
    on at
    RE: SSRS - Display Image in a report from an Image column Type

    Hi EBMRay,

    It's really a hard work and took me a long time. Finally, works out. Please follow the steps:

    1. Create a field to store the base64 string.(Please Maximize the field length.)

    pastedimage1660206627458v2.png

    2. Create an onchange event on your Image field.

    pastedimage1660206812761v3.png

    Code is like this:

    var validator = false;
    async function changeImage(executionContext){
        if(validator){
            return;
        }
        var formContext = executionContext.getFormContext();
        var image = formContext.getAttribute("cr1bc_companylogo").getValue();
        formContext.getAttribute("new_longbase64").setValue("");
        if(image){
             var base64 = await toBase64(image["_file"]);
    	   formContext.getAttribute("new_longbase64").setValue(base64.replace("data:image/jpeg;base64,",""));
    	   validator = true;
        }
    }
    
    const toBase64 = file => new Promise((resolve, reject) => {
        const reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = () => resolve(reader.result);
        reader.onerror = error => reject(error);
    });

    3. Open your form and change the image. The 'LongBase64' would auto filled.

    pastedimage1660206960087v4.png

    4. Create a SSRS report with the following FetchXML:

    
    
    
    
    
    
    
    
    

    5. Don't Add the Base64 String field to your report.

    pastedimage1660207163478v5.png

    6. Insert a column and then insert a image. Its setting like this:

    pastedimage1660207326178v6.png

    pastedimage1660207360913v7.png

    Expression: =System.Convert.FromBase64String(Fields!new_longbase64.Value)

    Note:  please change the MiMe type.

    Preview:

    pastedimage1660207491510v8.png

  • EBMRay Profile Picture
    903 on at
    RE: SSRS - Display Image in a report from an Image column Type

    Hello  ,

    I would highly appreciate your support for this issue.

    Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
DAnny3211 Profile Picture

DAnny3211 262

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 137 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 85 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans