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
BrickboxerBrickboxer 

Javascript included in Visualforce pages rendered as Excel?

When rendering a Visualforce page (which includes two page blocks and two data tables), the xls file includes a big block of javascript.

 

For example:

 

 

<script type="text/javascript"> if(!window.sfdcPage){window.sfdcPage = new ApexPage();}
UserContext.initialize({'locale':'en_US','timeFormat':'h:mm a','today':'9\/14\/2009 11:03 AM','userPreferences':[{'value':false,'index':112,'name':'HideInlineEditSplash'}
,{'value':true,'index':114,'name':'OverrideTaskSendNotification'}
,{'value':false,'index':115,'name':'DefaultTaskSendNotification'}
,{'value':false,'index':119,'name':'HideUserLayoutStdFieldInfo'}
,{'value':false,'index':116,'name':'HideRPPWarning'}
,{'value':false,'index':87,'name':'HideInlineSchedulingSplash'}
,{'value':true,'index':88,'name':'HideCRUCNotification'}
,{'value':true,'index':89,'name':'HideNewPLESplash'}
,{'value':false,'index':90,'name':'HideNewPLEWarnIE6'}
,{'value':false,'index':122,'name':'HideOverrideSharingMessage'}
],'startOfWeek':'1','isAccessibleMode':false,'ampm':['AM','PM'],'userId':'00580000001eyzn','dateTimeFormat':'M\/d\/yyyy h:mm a','dateFormat':'M\/d\/yyyy','language':'en_US','siteUrlPrefix':''}
);
</script>

 

 

Excel on a PC is happy to ignore this javascript, but Excel on a mac won't, and Numbers on a Mac completely chokes on it.

There's obviously no need to include this JS in the excel file. Is there a way to disable or remove this from the excel file?

 

 

 

Message Edited by Brickboxer on 09-14-2009 09:19 AM
pjcloudpjcloud

Has anyone ever found a solution to this?

JDCaseJDCase

I'm looking for this answer too. Anyone found a solution?

JDCaseJDCase

Found the answer! Instead of using:

<apex:column value="{!mydata}" />

 wrap the data in outputText:

<apex:column >
  <apex:outputText value="{!mydata}" />
</apex:column>