You need to sign in to do that
Don't have an account?
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?
Has anyone ever found a solution to this?
I'm looking for this answer too. Anyone found a solution?
Found the answer! Instead of using:
wrap the data in outputText: