spreadsheetAddRows treating strings like numbers and ending up with -1 as a value
Hi,
We have certain values (e.g., '1002-1', '1002-2', ... '1002-12') that end up as -1 when added to a spreadsheet via spreadsheetAddRows. Weirdly, '1002-13' is fine. Maybe spreadsheetAddRows is making bad guesses about whether a value is text vs a number? spreadsheetSetCellValue doesn't seem to have the problem. I reproduced the issue in cffiddle, although it looks like CF 2025 is going to fix the problem.
This cffiddle link shows the issue: https://cffiddle.org/app/file?filepath=b1d4c4bd-0989-4481-bcd3-46200ec39e7f/f4b909fd-a448-49ff-87da-91f8eb9f4d16/f29fc59a-821f-4481-9ad3-8f32869c6dd4.cfm
Has anyone run into this before, and do you happen to have a workaround?
thanks, Mark
<cfset testArray = [[ 'Bar, Foo', '1002-1', 'G009']]>
<cfset theSheetObj = SpreadsheetNew("tempSheet",true)>
<cfset spreadsheetAddRows(theSheetObj, testArray)>
<cfoutput>#SpreadsheetGetColumnCount(theSheetObj,1)#<br></cfoutput>
<cfoutput>#spreadsheetGetCellValue(theSheetObj, 1,1)#<br></cfoutput>
<cfoutput>#spreadsheetGetCellValue(theSheetObj, 1,2)#<br></cfoutput>
<cfoutput>#spreadsheetGetCellValue(theSheetObj, 1,3)#</cfoutput><br>
<cfset spreadsheetSetCellValue(theSheetObj, '1002-1', 1, 2)>
<cfoutput>#spreadsheetGetCellValue(theSheetObj, 1,2)#<br></cfoutput>
