Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Hiroki Taniura / Hiroki Taniura (Taniura Hiroki)
Created: 08/25/2015
Components: Document Management, Office Integration
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Win 2008 Server R2 64 bit
Vote Count: 1
Currently SpreadsheetWrite does not support protecting a sheet of .xlsx files.
https://wikidocs.adobe.com/wiki/display/coldfusionen/SpreadsheetWrite
It could be added to ColdFusion 11 because POI has been updated to 3.9 and POI 3.7 or later supports protecting sheets of .xlsx files.
Search for "48900" in the changelog below.
https://poi.apache.org/changes.html
Actually the code below can read Book.xlsx and output ProtectedBook.xlsx with a protected sheet.
<cfset f = createObject("java", "java.io.File").init("#ExpandPath('./Book.xlsx')#")>
<cfset myfile = createObject("java","java.io.FileInputStream").init(f)>
<cfset excelbook = createObject("java","org.apache.poi.xssf.usermodel.XSSFWorkbook")>
<cfset excelbook.init(myfile)>
<cfscript>
excelbook.setActiveSheet(0);
sheet = excelbook.getSheet("Sheet1");
sheet.protectsheet("password");
</cfscript>
<cfset objFileOutputStream = CreateObject("java","java.io.FileOutputStream").Init(JavaCast("string",ExpandPath( "./ProtectedBook.xlsx"))) />
<cfset excelbook.Write(objFileOutputStream) />
<cfset objFileOutputStream.Close() />
It would be nice if SpreadsheetWrite could do the same.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4042548
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: Taniura
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: