tracker issue : CF-4165319

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

cfspreadsheet on read alters cell data - auto trims the data

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Gordon Frobenius / Gordon Frobenius (Gordon Frobenius)

Created: 06/16/2016

Components: Document Management, Office Integration

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Few users will encounter

Locale/System: English / Windows 10 64 bit

Vote Count: 0

Listed in the version 2016.0.03.300466 Issues Fixed doc
Problem Description:
In CF10 using <cfspreadsheet> to read in an XLS file that has cells with leading and trailing spaces they were retained.  In CF11 and 2016 they are being automatically trimmed.  I don't think this would be desired 100% of the time.  Leave the customers data exactly as it were.

Steps to Reproduce:
Here is a working example: http://trycf.com/gist/cb811394b56fec0e5c3321f52c896852/acf2016?theme=monokai
You can select the version of CF to run it against in the bottom right.  You will see it is not the poi.jar that is auto trimming the data.

Actual Result:
In CF11 and 2016 cell data is auto trimmed.

Expected Result:
Data should be left as is.

Any Workarounds:
No.

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

Watson Bug ID:	4165319

External Customer Info:
External Company:  
External Customer Name: Gordon Frobenius
External Customer Email:  
External Test Config: My Hardware and Environment details:



(Server 1) This ColdFusion server appears to automatically trim the data (BAD)...

Version: 2016,0,02,299200

Update Level: chf20160002.jar



(Server 2) This ColdFusion server appears to leave the data as-is (GOOD)...

Version: 10,0,19,298511

Update Level: chf10000019.jar

Attachments:

Comments:

http://stackoverflow.com/questions/37866711/cfspreadsheet-cell-data-trim-issue-on-different-coldfusion-versions
Comment by External U.
2374 | June 16, 2016 04:15:50 PM GMT
In case the working example link doesn't work (http://trycf.com/gist/cb811394b56fec0e5c3321f52c896852/acf2016?theme=monokai), here is the code to reproduce the problem... <cfset cfSheet = SpreadSheetNew("Test")> <cfset SpreadSheetSetCellValue(cfSheet, " leading", 1, 1)> <cfset cfValue = SpreadSheetGetCellValue(cfSheet, 1, 1)> <cfset poiSheet = cfSheet.getWorkbook().getSheet("Test")> <cfset poiValue = poiSheet.getRow( 0 ).getCell( 0 ).getStringCellValue()> <cfoutput> SpreadSheet Functions: <hr> original length [#len(cfValue)#] <br> trimmed length [#len(trim(cfValue))#] <br> value = |#cfValue#| POI methods: <hr> original length [#len(poiValue)#] <br> trimmed length [#len(trim(poiValue))#] <br> value = |#poiValue#| </cfoutput>
Comment by External U.
2375 | June 17, 2016 09:38:42 AM GMT
@Piyush this fix will have impact on the bug CF-3680586.
Comment by Mayur J.
2376 | August 12, 2016 02:46:15 AM GMT
Hi Piyush, This below scenario you mentioned happens during spreadsheetaddRows(xl_obj, data_qry) method invocation. As data written to the spreadsheet is trimmed, while reading also we get the trimmed data. I think we need to raise a separate bug regarding the same.
Comment by Mayur J.
2377 | August 22, 2016 03:15:54 AM GMT