cancel
Showing results for 
Search instead for 
Did you mean: 

How to lock a cell value while exporting Excel

Former Member
0 Kudos
286

Hi Experts,

I have requirement for Excel Export ,While exporting Excel i need to make the lock for a cell value. Means which is non editable after export the Excel.

please help me how we can achieve this

View Entire Topic
former_member638520
Contributor
0 Kudos

Hi,

Which version do you use?

If >=1808 then you can override DefaultExcelCellService and in method insertAttributeValue(final Cell cell, final Object value) you can apply appropriate style to your cell:

 CellStyle lockedCellStyle = workbook.createCellStyle();
 lockedCellStyle.setLocked(true);
 cell.setCellStyle(lockedCellStyle);

Regards,

Lukasz

Former Member
0 Kudos

Thank you so Lukasz, we are using v1808 , can you please elaborate how i can lock the excel cell value for few attributes values only.
Exp: Product ID and Product Id Domain cell i need to lock , while doing the Excel Export