tracker issue : CF-4050099

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

[ANeff] Bug for: spreadsheetFormatRow()/spreadsheetFormatColumn() locked=false doesn't unlock entire row/column

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/ThirdParty

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 09/05/2015

Components: Document Management, Office Integration

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win All

Vote Count: 0

spreadsheetFormatRow()/spreadsheetFormatColumn() locked=false doesn't unlock entire row/column

Repro:

<cfscript>
  mySpreadsheet = spreadsheetNew("mySheet", false);
  spreadsheetAddRows(mySpreadsheet, ["one,two,three","four,five,six","seven,eight,nine"], 1, 1);
  spreadsheetFormatRow(mySpreadsheet, {locked=false}, 2);
  spreadsheetFormatColumn(mySpreadsheet, {locked=false}, 2);
  spreadsheetWrite(mySpreadsheet, expandPath("./myspreadsheet.xls"), "", true);
</cfscript>

Actual result: only the populated cells in row 2 and column 2 were unlocked

Expected result: all cells in row 2 and column 2 should be unlocked

spreadsheetFormatCellRange() isn't a valid workaround b/c it actually populates all unpopulated cells w/ empty strings (bug IMO).

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

Watson Bug ID:	4050099

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email:  
External Test Config: Verified in CF11 Update 5 (build 11,0,05,293506)

Attachments:

Comments:

I verified the bug using below code. <cfspreadsheet action="read" src="C:\a11.xls" sheetname="sheetname" name="spreadsheetData"> <cfscript> spreadsheetFormatRow(spreadsheetData, {locked=false}, 2); spreadsheetFormatColumn(mySpreadsheet, {locked=false}, 2); spreadsheetWrite(spreadsheetData, expandPath("./myspreadsheet.xls"), "", true); </cfscript> where a11.xls is a protected sheet. What user has confirmed is true. Only the populated cells in row 2 and column 2 were unlocked. Empty cells were locked. All cells in row 2 and column 2 should be unlocked
Comment by Poonam J.
6012 | September 05, 2015 03:54:42 AM GMT
Poi dosen't allow to unlock empty cell. One can unlock whole spreadsheet and then lock it with appropriate changes. Please refer the below mentioned link. http://stackoverflow.com/questions/12696971/how-to-create-a-cfspreadsheet-with-protected-cells
Comment by Mayur J.
6013 | September 22, 2015 07:13:14 AM GMT
as a workaround one can use the spreadsheetFormatCellRange method in the following manner: _max_col_no = _max_row_no = 10; ss_obj = spreadsheetNew("mySheet", false); spreadsheetAddRows(ss_obj, ["one,two,three","four,five,six","seven,eight,nine"], 1, 1); //spreadsheetFormatRow(ss_obj, {locked=false}, 2); // doesnt unlock the empty cells, i.e, all cells in the second row from D2 and beyond. spreadsheetFormatCellRange(ss_obj, {locked=false}, 2, 1, 2, _max_col_no); // alterative. unlocks the cell till the col. specified in _max_col_no //spreadsheetFormatColumn(ss_obj, {locked=false}, 2); // doesnt unlock the empty cells, i.e, all cells in the second col from B4 and beyond. spreadsheetFormatCellRange(ss_obj, {locked=false}, 1, 2, _max_row_no, 2); // alterative. unlocks the cell till the row. specified in _max_row_no spreadsheetWrite(ss_obj, expandPath("./xl-data.xls"), "pswd", true);
Comment by Piyush K.
6014 | September 24, 2015 09:05:43 AM GMT
Hi Piyush, That workaround isn't sufficient b/c there is no way to know how many columns ss_obj has. And specifying _max_col_no 256 and _max_row_no=65536 isn't a workaround b/c it actually creates additional rows and columns (thus increasing the size of the spreadsheet object/file). I've filed ER CF-4066274 to add ss_obj.columnCount. That would then resolve the issue. Thanks!, -Aaron
Comment by External U.
6015 | September 29, 2015 05:28:54 PM GMT