poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alamu <alamu_engin...@yahoo.com>
Subject Re: setCellStyle (HSSFStyle) in poi-3.2-FINAL-20081019.jar throws exception
Date Mon, 27 Apr 2009 15:42:08 GMT

Hi,
Thank you so much for the response, Nick.

Requirement:
a. Copy worksheets from one workbook to another workbook (including styles,
formats etc.)
b. After copying all sheets, make the sheets as protected except the first
worksheet.  First worksheet is user editable.

Protecting the worksheet (without protecting the workbook) works fine.  
But, if formats, styles etc. is applied to copying the worksheet and calling
the method protectSheet("") doesn't work.

Can anyone provide sample code or tell how to do the above.  
i) copy sheets from one workbook to another.  
ii) after copying, make the sheet as read-only.

Also, please let me know if the above CANNOT be done using POI.

Thanks again.



I think that you need to write protect the workbook as well. As I understand
the process, you need to call the sheet.protectSheet() method on each sheet
in the workbook and then the workbook.writeProtectWorkbook(java.lang.String
password, java.lang.String username) which, to quote the javadoc, "protect a
workbook with a password (not encypted, just sets writeprotect flags and the
password."



-- 
View this message in context: http://www.nabble.com/setCellStyle-%28HSSFStyle%29-in-poi-3.2-FINAL-20081019.jar-throws-exception-tp23198948p23259066.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message