【发布时间】:2020-06-18 06:46:24
【问题描述】:
我正在将 VF 页面导出为 Excel 文档。当我导出 excel 文件时,图像单元格包含空白数据。下面是我的 VF 页面代码。如果我使用静态 url (<img alt="Image" src="https://myorgurl/resource/DefaultProfileImage" />) 而不是动态图像 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>
<image 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>
我已尝试在 VF 页面中使用 XML 结构而不是 HTML 标记来解决此问题,但它不起作用。
【问题讨论】:
标签: excel salesforce apex visualforce