Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 09/29/2015
Components: Document Management
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Win All
Vote Count: 0
Currently a spreadsheet object has a rowCount key but does not have a columnCount key. This complicates the formatting of only defined cells.
Steps to reproduce:
1) Run this:
<cfscript>
mySpreadsheet = spreadsheetNew("mySheet", false);
spreadsheetAddRows(mySpreadsheet, ["one,two,three","four,five,six","seven,eight,nine"], 1, 1);
spreadsheetFormatCellRange(mySpreadsheet, {locked=false}, 1, 2, mySpreadsheet.rowCount, 2);//format only the defined cells
spreadsheetFormatCellRange(mySpreadsheet, {locked=false}, 2, 1, 2, getSpreadsheetColumnCount(mySpreadsheet, "mySheet"));//format only the defined cells
spreadsheetWrite(mySpreadsheet, expandPath("./myspreadsheet.xls"), "", true);
cfspreadsheet(action="read", src=expandPath("./myspreadsheet.xls"), query="q");
writeDump(q);
numeric function getSpreadsheetColumnCount(required spreadsheet, required sheetname) {//workaround (to be implemented for mySpreadsheet.columnCount per this ER)
var result = 0;
var sheet = ARGUMENTS.spreadsheet.getWorkbook().getSheet(ARGUMENTS.sheetname);
for(var currentRowNum=1; currentRowNum lt ARGUMENTS.spreadsheet.rowCount; currentRowNum++) {
result = max(result, sheet.getRow(currentRowNum).getLastCellNum());
}
return result;
}
</cfscript>
2) See I wanted to only format defined cells. But spreadsheet object did not tell me how many columns there are. So, in getSpreadsheetColumnCount(), I found which row has the maximum number of *defined* cells (via getLastCellNum()) and returned the result.
This ER is to do the same as getSpreadsheetColumnCount() to populate a spreadsheet's new "columnCount" key.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4066274
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
Attachments:
Comments: