Hi,

Can any one help me to make excel cell as read only.After creating workbook
using POI,want make sure some of the columns in a sheet are read only.

I'm using following code to achieve this but it not showing the cell
value.But when I try to edit the cell it is prompting error.


CellRangeAddressList addressList = new CellRangeAddressList(3, 3, i, i);
DVConstraint dvConstraint = DVConstraint.createExplicitListConstraint(new
String[] {"ReadOnlyCell"});
HSSFDataValidation dataValidation = new HSSFDataValidation(addressList,
dvConstraint);
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setEmptyCellAllowed(false);
dataValidation.createErrorBox("Error", "Cell can not be editable");
sheet.addValidationData(dataValidation);

Please let me know if any other solutions for this.

Regards,
Naga.




-----
Regards,
Naga.
-- 
View this message in context: 
http://www.nabble.com/How-to-make-readonly-cell-tp24367500p24367500.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to