Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
10-11-2013, 01:46 AM #1
- Join Date
- Apr 2012
- St. Louis, MO
- Thanked 101 Times in 101 Posts
cfheader/cfcontent issue with streaming .xlsx file
I've got a page that generates a Spreadsheet object and streams it directly to the browser using CFHEADER and CFCONTENT. The issue is IE8 (surprise! moan). It will open three (sometimes four) instances of Excel 2010, the first of which is blank, and the rest are all the same - the generated content.
I'll include a sample page that I created just for this post. It works great in IE9, IE10, FF21, FF23, and Chrome. Only IE8 (haven't tested 7) opens several Excel apps (all the ones after the first throw an alert box that "such n such file is opened by userx; open read only, or notify when it becomes available?" (I'm paraphrasing.)
Here's my code for test.cfm:
<cfset s = SpreadsheetNew("Metrics","yes")> <cfset spreadsheetMergeCells(s,1,1,1,3)> <cfset spreadsheetSetCellValue(s,"TEST Metrics",1,4)> <cfset brwsrList = "IE7,IE8*,IE8,IE9*,IE9,IE10*,IE10,IE11*,IE11,FireFox,Chrome"> <cfset brwsrIdx = 4> <cfloop list="#brwsrList#" index="idx"> <cfset spreadsheetSetCellValue(s,idx,3,brwsrIdx)> <cfset brwsrIdx++> </cfloop> <cfset format1 = StructNew()> <cfset format1.font = "Calibri"> <cfset format1.fontsize = "11"> <cfset spreadsheetFormatColumns(s,format1,"1-1000")> <cfheader name="Content-Disposition" value="attachment; filename=test.xlsx"> <cfcontent type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" variable="#spreadsheetReadBinary(s)#" reset="true">^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".