You need to sign in to do that
Don't have an account?

Problems in exporting Excel documents in MAC
I have used the same code as provided for exporting in my application.In Windows the excel gets exported in a proper manner but when I try to export in MAC OS I get the code written inside the script tag from Salesforce's side.Here is the gibberish code that I get
if(!window.sfdcPage){window.sfdcPage = new ApexPage();}
UserContext.initialize({'isAccessibleMode':false,'ampm':['AM','PM'],'locale':'en_US','dateTimeFormat':'M/d/yyyy h:mm a','today':'1/28/2009 2:37 AM','dateFormat':'M/d/yyyy','language':'en_US','siteUrlPrefix':'','userPreferences':[{'value':false,'index':119,'name':'HideUserLayoutStdFieldInfo'}
,{'value':false,'index':87,'name':'HideInlineSchedulingSplash'}
,{'value':false,'index':116,'name':'HideRPPWarning'}
,{'value':false,'index':115,'name':'DefaultTaskSendNotification'}
,{'value':false,'index':114,'name':'OverrideTaskSendNotification'}
,{'value':false,'index':112,'name':'HideInlineEditSplash'}
],'startOfWeek':'1'}
);
Is this a SalesForce bug or an error from our side.If it is an error do I need to log a bug??
I get the same error. But till now I don't have a solution. But I'm still working on it. You said it working in Windows?
I recognized, that this "xls" File is open with writer in OpenOffice instead of calc. Maybe something wrong with the Header?
I have the same issue and although I see others posting the issue I've not seen a solution (maybe because its obvious once you dig a little). Anyway the issue is that some tags (pageBlock, pageBlockTable ) are not (at least Mac OSX) excel friendly. So I constructed my excel export page with apex:dataTable without using these tags and it worked appropriately. Sample below. Hope this saves someone else the hour or so it took me to figure out.
I suspect your problem is that you are using outputField vs. outputText. Try it with outputText and all should be good.
I had the same problem - was doing outputText for most fields, but was doing outputField for a date field. Switching to 100% outputText removed the Javascript.
I also found that apex:sectionHeader also introduced the script garbage at the top of the document..
I was able to replace this successfully with an apex:outputText instead: