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 TrackerStatus/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
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: