Title: 
  Using SpreadSheetFormatCellRange and other SpreadSheetFormat functions may create corrupted Excel spreadsheets
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): John Dobbins / John Dobbins (John Dobbins)
Created: 09/26/2013
Components: Document Management, Office Integration
Versions: 10.0
Failure Type: Data Corruption
Found In Build/Fixed In Build: Final /
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Windows 7 64-bit
Vote Count: 1
Problem Description:
When creating a spreadsheet using the cfscript SpreadSheet functions, any time a format is applied to a cell, a separate Excel style is created and applied to that cell, even if the same format is used on other cells.  Therefore, if you format 100 cells, CF generates 100 style definitions in the "styles.xml" file, with unique references to each style in the XML file containing the sheet.  Since I'm formatting over 65,000 cells, CF is generating that many style definitions and is apparently exceeding the Excel maximum for the number of styles.
Opening the generated spreadsheet results in the error "Excel found unreadable content in 'bigSheetTest.xlsx'.  Do you want to recover the contents of this workbook?".
Steps to Reproduce:
This error may be reproduced using the uploaded cfm file (note that the file writes the geneated spreadsheet to the root of the C: drive; change this as appropriate).  With the "maxRows" variable set to 725, opening the generated sheet will result in an Excel error.  However, setting the value to 724 will produce a valid spreadsheet.
Actual Result:
By viewing the Excel "styles.xml" and "sheet1.xml" files, it is clear that every formatted cell has a separate style definition, even those cells formatted using the SpreadSheetFormatCellRange function.
Expected Result:
Only unique style definitions should be created.  In the sample code, I'm only using four different styles, and yet over 65,000 style definitions are being created.
Any Workarounds:
None that I am aware of.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID:	3640428
External Customer Info:
External Company:  
External Customer Name: jbdobs
External Customer Email:  
External Test Config: My Hardware and Environment details:
Windows 7 Enterprise (64 bit) with 8 Gig of RAM, Intel Core i7-3520M CPU @ 2.90GHz
Microsoft Office Professional Plus 2010
Microsoft Excel Version 14.0.7106.5001 (32-bit)
 
System Information
Server Details
Server Product	ColdFusion
Version	ColdFusion 10,285437
Edition	Developer  
Operating System	Windows 7  
OS Version	6.1  
Update Level	/C:/ColdFusion10/cfusion/lib/updates/chf10000011.jar  
Adobe Driver Version	4.1 (Build 0001)  
 
 
 
JVM Details
Java Version	1.7.0_15  
Java Vendor	Oracle Corporation  
Java Vendor URL	http://java.oracle.com/  
Java Home	C:\ColdFusion10\jre  
Java File Encoding	Cp1252  
Java Default Locale	en_US  
File Separator	\  
Path Separator	;  
Line Separator	Chr(13)  
User Name	F1610-7X7HKX1-L$  
User Home	C:\  
User Dir	C:\ColdFusion10\cfusion\bin  
Java VM Specification Version	1.7  
Java VM Specification Vendor	Oracle Corporation  
Java VM Specification Name	Java Virtual Machine Specification  
Java VM Version	23.7-b01  
Java VM Vendor	Oracle Corporation  
Java VM Name	Java HotSpot(TM) 64-Bit Server VM  
Java Specification Version	1.7  
Java Specification Vendor	Oracle Corporation  
Java Specification Name	Java Platform API Specification  
Java Class Version	51.0
  Attachments:
- September 27, 2013 00:00:00: 1_bigSheetTest.cfm
 
Comments: