tracker issue : CF-4009541

select a category, or use search below
(searches all categories and all time range)
Title:

Spreadsheet writing is changing column formatting for currently active sheet

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/Workaround

Reporter/Name(from Bugbase): Alan Holden / Alan Holden (Alan Holden)

Created: 06/18/2015

Components: Document Management, Office Integration

Versions: 11.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / Few users will encounter

Locale/System: English / Windows 7

Vote Count: 0

Problem Description: Reading an existing xlsm multi-worksheet spreadsheet (with or without any interim process) will noticeably alter the look and layout of any worksheet which is set active at the time of writing.

Steps to Reproduce: 1) Examine the worksheets of the attached source file(*) prior to processing. Notice the similar format in each 'weekday tab'
2) Run the following CFML against the file (brackets removed for posting here):
cfspreadsheet action="read" src="#ExpandPath('./template_001_layout_120200.xlsm')#" sheet="1" name="sheetObj"
cfspreadsheet action="write" name="sheetObj" filename="#ExpandPath('./demoSpreadSheetBug.xlsm')#" overwrite="true"
3) Examine the resulting file saved by ColdFusion. Note how the first sheet ('Mon') has suffered from sheet & column resizing, etc in multiple places.
4) Inject the following cfscript between the two lines of code above to change the active sheet before writing:
 SpreadsheetSetActiveSheetNumber (sheetObj, 2); 
5) Example the resulting file and see how sheet 2 ('Tue') is now the victim of bad format karma. Repeat with different sheet attributes if desired.

Actual Result: Active sheet is formatted to an unintended appearance which makes customer angry.

Expected Result: All sheets would appear the same as in the file supplied by the happy customer.

Any Workarounds: Set the active sheet to one that has no format, or the customer does not care about, which unfortunately will also be the one they first see (eg 'Active') when opening the file in Excel or OpenOffice. Other than that, no other workaround has been found - without spending hours or days attempting to manipulate the file via direct invocation of the POI libraries.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4009541

External Customer Info:
External Company:  
External Customer Name: Alan
External Customer Email:  
External Test Config: My Hardware and Environment details: ColdFusion 11,0,05,293506  Enterprise (Developer) 

Windows 7   

OS Version 6.1

Update Level /C:/ColdFusion11/cfusion/lib/updates/chf11000005.jar

Adobe Driver Version 	5.1.3 (Build 000094)

Java Version 	1.8.0_25  

Java Class Version 	52.0

Error Occurred While Processing Request

The filename, directory name, or volume label syntax is incorrect

The error occurred in _report.cfm: line 389

Called from _report.cfm: line 67

Called from _report.cfm: line 1

Called from index.cfm: line 41

-1 : Unable to display error's location in a CFML template.

Attachments:

  1. June 19, 2015 00:00:00: 1_template_001_layout_120200.txt

Comments:

ATTACHED FILE HAS BEEN RENAMED from xlsm to txt for uploading. Please rename back for testing. The customer who brought me this issue first experienced it on an Edge server running CF10 The actual process inserts a bunch of data in the last sheet, which is then used throughout the template, but everything else has been stripped out to demonstrate the core problem. Oh, and see you guys in Las Vegas!
Comment by External U.
7213 | June 18, 2015 10:12:22 PM GMT
Please try to use the attribute autosize="false" Here is the code snippet <cfspreadsheet action="read" src="#ExpandPath('./template_001_layout_120200.xlsm')#" name="sheetObj"> <cfscript> SpreadsheetSetActiveSheetNumber (sheetObj, 2); </cfscript> <cfspreadsheet action="write" name="sheetObj" filename="#ExpandPath('./demoSpreadSheetBug.xlsm')#" overwrite="true" autosize="false">
Comment by Mayur J.
7214 | September 22, 2015 07:27:03 AM GMT
Hi Mayur, Can you please document autosize's default value? The cfspreadsheet doc does not specify the default value for the autosize attribute. From your comment here, it appears the default value is true. Regardless, it should be documented. Thanks!, -Aaron
Comment by External U.
7215 | September 23, 2015 01:58:08 AM GMT
Addition of attribute autosize="false" resolves this use case - under build 11,0,05,295053 I agree with Aaron, the documentation could use some enhancement in the area of this newly added attribute. What is the default, and which sheets are affected under what parameter conditions, etc. The word itself is only mentioned 3 times on the wiki page. Thanks.
Comment by External U.
7216 | September 23, 2015 02:16:47 PM GMT
Adobe, I see this ticket is Closed/NeverFix/Workaround. Can you please document the autosize="false" default value? Thanks!, -Aaron
Comment by External U.
7217 | September 25, 2015 03:31:11 PM GMT
Aaron, By default the value of the autosize parameter is true. If the value is set to false, the width of the output spreadsheet column will not be automatically re-sized to accommodate it's content. We'll fix the documentation at: https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-r-s/cfspreadsheet.html
Comment by Piyush K.
7218 | October 15, 2015 01:19:31 AM GMT
Hi Piyush, Thanks and yes I meant autosize="true" =P I see the doc is updated; awesome. Thanks!, -Aaron
Comment by External U.
7219 | December 04, 2015 05:27:56 AM GMT