/ Published in: Other
Credits to Sati Hillyer & Jeff Douglas
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<apex:page standardController="Account" contentType="application/vnd.ms-excel#FILENAME.xls" cache="true"> <apex:pageBlock title="Hello {!$User.FirstName}!"> You are viewing the {!account.name} account. </apex:pageBlock> <apex:pageBlock title="Contacts"> <apex:pageBlockTable value="{!account.Contacts}" var="contact"> <apex:column value="{!contact.Name}"/> <apex:column value="{!contact.Email}"/> <apex:column value="{!contact.Phone}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
URL: http://blog.sforce.com/sforce/2008/12/visualforce-to-excel.html