function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rohit2006Rohit2006 

contentType application/vnd.ms-excel does not work in IE7

Hi I have developed a following VF page
<apex:page sidebar="false"  controller="BES_exportCasesToCSVController" contentType="application/vnd.ms-excel#Cases.xls">
<apex:PageBlock >
<apex:PageBlockTable value="{!cases}" var="case" rowClasses="odd,even" styleClass="tableClass" >
<apex:column >
<apex:facet name="header">Practice Name</apex:facet>
<apex:outputText value="{!case.Practice_Name__r.Name}"/>
</apex:column>
</apex:PageBlockTable>
</apex:PageBlock>
</apex:page>

This gives me excel file for the pageBlockTable contents when I execute this in Firefox
or Google Chrome browser,but when I run this in IE 7 an error box pops up displaying following
message
---------------------------
Windows Internet Explorer
---------------------------
Internet Explorer cannot download exportCasesToCSV from c.cs2.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.
---------------------------
OK
---------------------------

I need this working in IE because client uses IE7. Pls tell me any workarounf for this. I am ready to go for SControl
also if there is no way in VisualForce



Best Answer chosen by Admin (Salesforce Developers) 
Paul GostelowPaul Gostelow

I know this is an old thread, but I fixed this problem by adding the cache="true""attribute to the apex:page attributes:

 

<apex:page standardController="xxx__c" sidebar="false" cache="true" contenttype="application/vnd.ms-excel">

All Answers

dchasmandchasman
See this post - IE7 has some interesting issues around HTTPS and cache headers etc. We are aware of this and at some point in the future the workaround will not be necessary.
Kirtesh_JainKirtesh_Jain
I am facing same type of Problem in IE6-7, any work around of it now.
Paul GostelowPaul Gostelow

I know this is an old thread, but I fixed this problem by adding the cache="true""attribute to the apex:page attributes:

 

<apex:page standardController="xxx__c" sidebar="false" cache="true" contenttype="application/vnd.ms-excel">

This was selected as the best answer
mshelmanmshelman

Thanks a lot, Paul