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%;">
<thead>
<tr>
<th>Profile Image</th>
<th>Name</th>
<th>City</th>
<th>State</th>
</tr>
</thead>
<tbody>
<apex:repeat value="{!lstUsers}" var="user">
<tr>
<td>
<img alt="Image" src="{!BaseUrl}{!URLFOR($Resource.DefaultProfileImage)}" />
</td>
<td>{!user.Name}</td>
<td>{!user.City__c}</td>
<td>{!user.State__c}</td>
</tr>
</apex:repeat>
</tbody>
</table>
</apex:page>
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.