I am exporting a VF page as Excel document. While I export excel file, Image cell contains blank data. Below is my VF page code. It is working fine if I am using static url (<img alt="Image" src="https://myorgurl/resource/DefaultProfileImage" />) instead of dynamic Image url.

<apex:page controller="Users_Profile" contentType="application/vnd.ms-excel#Users.xls">
    <table border="0" cellspacing="0" cellpadding="0" style="width:100%;">
                <th>Profile Image</th>
            <apex:repeat value="{!lstUsers}" var="user">
                        <img alt="Image" src="{!BaseUrl}{!URLFOR($Resource.DefaultProfileImage)}" />

I have tried XML structure instead of HTML tags in VF page to get this resolved but it is not working. I referred following answered questions but did not get solution for this.

  1. Image not getting displayed in exported excel from VF page
  2. How to display image from Static Resource in Excel sheet (generated from VF Page)
  • If typing out the URL manually works, that makes me suspect the merge fields aren't constructing the URL appropriately and not that there is an issue with Excel rendering the image or a permissions issue around the image being shown in a spreadsheet. Can you check what the merge fields are constructing to verify that it is identical to typing in the URL manually?
    – nbrown
    Commented Jun 18, 2020 at 14:11


You must log in to answer this question.

Browse other questions tagged .