+ Start a Discussion
iceberg4uiceberg4u 

Error while exporting documents in MAC OS.

I am exporting an Excel document on a button click The document gets exported to Excel in proper format in Windows.

 

But when I try to do the same in MAC OS I get  a top mline on the excel sheet with a jumble of computer code in the top.The document I want is produced fine after that.

 

My VF page code:->

<apex:page controller="InvoiceDataExportController" contenttype="application/vnd.ms-excel"
title="Invoice Export"
>
    <apex:pageBlock title="Invoice Details">
        <apex:pageBlockTable value="{!InvoiceDetails}" var="invDetail" border="1">
            <apex:column headerValue="Invoice Number" value="{!invDetail.First}" />
           
            <apex:column headerValue="Supplier" value="{!invDetail.Fifteenth}" />
            <apex:column headerValue="Purchaser" value="{!invDetail.Twelth}" />
            <apex:column headerValue="Invoice Date" value="{!invDetail.Sixteenth}" />
           
            <apex:column headerValue="Confirmed at Purchaser" value="{!invDetail.Seventh}" />
            <apex:column headerValue="Confirmed at Supplier" value="{!invDetail.Eighth}" />
           
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 

The gibbersih code that I have at the top is :->

 

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/16/2009 1:31 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'} );

 

h8r41dh8r41d

Can somebody please explain how to get rid of this javascript ?