Posted by
Unknown
02:11

In this short post I want to explain how we can generate an excel output from a VF page. We already know to how to generate a PDF from VF page.
(Read more to find out how). One of the common requirements is to convert a VF page with data into an Excel sheet, here are some things you may want to keep in mind
- Use a separate VF page for export. It is advisable to use a separate VF page to export off, reason being, usually the VF page in which data resides contains buttons, links images etc. and that is not something you usually want in your excel
- Use <apex:dataTable> : this gives you a consistent output and works for both windows and MAC. (Thank you for the Info)
- Proper validation : Before the export page is reached, make sure all validations to ensure data will be present is a good practice