tracker issue : CF-3923995

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

spreadsheetAddRows: When passing arrays (without passing the row/col attribs) the order of the array elements is not correctly written in the spreadsheet.

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): / ext-user (Piyush Kumar Nayak)

Created: 01/20/2015

Components: Document Management, Office Integration

Versions: 11.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11,0,04,292860 / CF11 Update5

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Windows 7 SP1 64-bit

Vote Count: 0

Listed in the version 11.0.05.293506 Issues Fixed doc
Related Bugs:
CF-3043160 - Similar to


Problem:
spreadsheetAddRows: When passing arrays (without passing the row/col attribs) the order of the array elements is not correctly written in the spreadsheet.

Method:
<cfset file_separator = IIF((server.os.name CONTAINS "windows"), DE("\"), DE("/"))>
<cfset sh_name = "arr-sh1">
<cfset arr = ["one", "2", "three", "four", "V", "VI", "7"]>
<cfscript>
  out_fl = expandPath(".") & file_separator & "ss-arr.xls";
  try 
  {
	ss_obj = spreadsheetNew("spreadsheetAddRowsWithArray", "false");
	spreadsheetAddRows(ss_obj, arr);
  }
  catch(any ex)
  {
	writeOutput("exception occured. test FAILED." & "<br>");
	writeOutput("Exception Message : " & ex.message & "<br>");
	writeOutput("Exception Details : " & ex.detail & "<br>");
  }    
</cfscript>

<cfspreadsheet action="write" filename="#out_fl#" name="ss_obj" sheetname="#sh_name#" overwrite="true">
<cfspreadsheet action="read" src="#out_fl#" query="read_qry">

<cfloop query="read_qry">
<cfloop list="#ArrayToList(read_qry.getColumnNames())#" index="col">
	<cfoutput>#read_qry[col][currentrow]#</cfoutput><br>
</cfloop>
</cfloop>



Result:
three
four
V
VI
7
one
2

Expected:
one
2
three
four
V
VI
7

Workaround:
pass the row/col attribs as well.

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

Watson Bug ID:	3923995

External Customer Info:
External Company:  
External Customer Name:  
External Customer Email:

Attachments:

Comments:

The fix for this bug is available in the pre-release build of ColdFusion 11 Update 5
Comment by CFwatson U.
8889 | February 20, 2015 09:24:42 AM GMT
The following result is the same in CF11 Update 4 and CF11 Update 5: ----------- exception occured. test FAILED. Exception Message : An exception occurred while calling the function addRow. Exception Details : java.lang.IllegalArgumentException: Invalid row number (-1) outside allowable range (0..65535) one ----------- It appears nothing was fixed/changed. Why is this ticket marked Closed/Fixed? Thanks!, -Aaron
Comment by External U.
8890 | September 05, 2015 03:14:44 AM GMT