Change the MIME type of Your Visualforce Page
Change the MIME type of Your Visualforce Page
You can specify a different format for a Visualforce page by using the contentType attribute on the <apex:page> tag. This sets the HTTPContent-Type header for the response to the value of the
page’s contentType attribute.
The contentType attribute takes a Multipurpose Internet Mail Extension (MIME) type as a value, such as application/vnd.ms-excel, text/csv, or image/gif.
For example, to display Visualforce page data in a Microsoft Excel spreadsheet,
use the contentType attribute on the
<apex:page> tag. Specify a value
of application/vnd.ms-excel.
This Visualforce page builds a list of cases by using static HTML and the
<apex:repeat>
component.