Title:
ER: spreadsheetAddRows should accept 2D arrays for populating spreadsheets.
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): / ext-user (Piyush Kumar Nayak)
Created: 03/19/2015
Components: Document Management, Office Integration
Versions: 11.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 11,0,04,293328 /
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Mac 10 All,Win XP All
Vote Count: 4
Problem:
spreadsheetAddRows should accept 2D arrays for populating spreadsheets.
Method:
out_fl = "#expandpath("./")#outdata.xlsx";
xlobj = SpreadsheetNew("2d_arr_data", true);
qry_data = queryNew("cellA_data, cellB_data, cellC_data");
queryAddRow(qry_data, {cellA_data:"a1", cellB_data="b1", cellC_data="c1"});
queryAddRow(qry_data, {cellA_data:"a2", cellB_data="b2", cellC_data="c2"});
writeDump(qry_data);
arr2d = [["a1","b1","c1"],["a2","b2","c2"]];
writeDump(arr2d);
spreadsheetAddRows(xlobj, arr2d, 2, 1);
cfspreadsheet(action="write", filename="#out_fl#", name="xlobj", overwrite=true);
cfspreadsheet(action="read", src="#out_fl#", query="qryxl");
writeDump(qryxl);
Result:
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.
Null Pointers are another name for undefined values.
The error occurred in C:/inetpub/cf11/ss/delim.cfm: line 20
20 : spreadsheetAddRows(xlobj, arr2d, 2, 1);
java.lang.NullPointerException
at coldfusion.runtime.CFPage.SpreadSheetAddRows(CFPage.java:8696)
at coldfusion.runtime.CFPage.SpreadSheetAddRows(CFPage.java:8649)
at coldfusion.runtime.CFPage.SpreadSheetAddRows(CFPage.java:8735)
at cfdelim2ecfm1951762110.runPage(C:\inetpub\cf11\ss\delim.cfm:20)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)
Expected:
The same output as is achieved by replacing
spreadsheetAddRows(xlobj, arr2d, 2, 1);
with
spreadsheetAddRows(xlobj, qry_data, 2, 1);
Workaround:
n/a
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3956121
External Customer Info:
External Company:
External Customer Name:
External Customer Email:
Attachments:
Comments: