+ Start a Discussion
HeenaHeena 

Saving visualforce page as Excel

Hi,

 

I have a requirement to export all the list of records that I display using datatable  to an excel.

I tried using the Contenttype attribute of page.

This works fine in firefox but throws the following error in IE.

 

 Internet Explorer cannot download "my visualforce page name" fromc.na6.visual.force.com.

 Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.

 

 Please help.

 

 

Please help.

Best Answer chosen by Admin (Salesforce Developers) 
SteveAnderson41SteveAnderson41
and sometimes you need to set cache="true" also.

All Answers

JimRaeJimRae

I have heard that sometimes it is necessary to include a document name as part of the contenttype to support IE issues.

 

 

contentType="application/vnd.ms-excel#Cases.xls"

 you might try that.

 

 

SteveAnderson41SteveAnderson41
and sometimes you need to set cache="true" also.
This was selected as the best answer
HeenaHeena

Thanks Steve and Jim.

 

I was giving the name but was not aware about the cache attribute. Thanks a lot.

 

 

Regards,

Heena B