You need to sign in to do that
Don't have an account?
Gennadiy
VisualForce to Excel: images not displayed
Hi, Guys.
I'm trying to create a VF-page which is opened as Excel file. I didn't meet any problems with text, tables, CSS-styles, but I can't insert images into the document. Images are not displayed (I can see their borders only) in Excel editor.
Let me provide simple test code of my VisualForce page:
Does anybody know how we can correctly insert images in Excel-files?
I'm trying to create a VF-page which is opened as Excel file. I didn't meet any problems with text, tables, CSS-styles, but I can't insert images into the document. Images are not displayed (I can see their borders only) in Excel editor.
Let me provide simple test code of my VisualForce page:
<apex:page controller="TEST_ExcelReportController" standardStylesheets="false" sidebar="false"
showHeader="false" showChat="false" contentType="application/vnd.ms-excel#Test_ExcelReport.xls">
<table>
<tr>
<td>
<apex:image url="http://icons.iconarchive.com/icons/benjigarner/softdimension/256/Excel-icon.png"/>
</td>
<td>
<img src="http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif"/>
</td>
</tr>
</table>
</apex:page>
showHeader="false" showChat="false" contentType="application/vnd.ms-excel#Test_ExcelReport.xls">
<table>
<tr>
<td>
<apex:image url="http://icons.iconarchive.com/icons/benjigarner/softdimension/256/Excel-icon.png"/>
</td>
<td>
<img src="http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif"/>
</td>
</tr>
</table>
</apex:page>
Does anybody know how we can correctly insert images in Excel-files?
Thank you, srilakshmi1.
One more point about this simple page. Images are not displayed in Microsoft Excel 2011 for Mac.
Does anybody know how we can display images for Excel 2011 for Mac?
We are having this issue with Excel 2013. Images are not displaying. Any idea how to resolve this issue?
Thanks,
Rudi
I didn't find a way how to make it working in MS Excel for Mac although it worked good in MS Excel 2010 for Windows. After many efforts I made the following conclusions:
- Salesforce does not provide normal way to generate Excel documents;
- All that we are trying to do is to generate html/xml content which can be recognized by MS Excel. But, of course, MS Excel expects to get binary files. Support of all other files is optional and depends more on a local environment/configuration than on a format of your html/xml content. So, you can never guarantee that your image will be displayed correctly in different versions of MS Excel in different environments (Windows/Linux/Mac)
- Because of 2 facts above, it's better to exclude images from the template.
Of course, if, after all, you find any real working approach for this issue, it would be great if you share some details with us.