You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Shinde, Amol" <as...@emptoris.com> on 2011/06/30 11:51:05 UTC

Specific user edit actions on locked sheet

Hi,
I have an issue with the protected/locked sheets in xlsx file format. My sheet is locked and I want to unlock specific user edit actions say insert columns, insert rows etc.

POI 3.7 defines some methods in XSSFSheet.java class like lockInsertColumns(), lockInsertRows() and few more.
They should actually allow inserting columns/rows, if sheet is already protected/locked.
They actually work reverse of what is expected and pass true to underlying API of CTWorksheet.

public void lockInsertColumns() {
        createProtectionFieldIfNotPresent();
        worksheet.getSheetProtection().setInsertColumns(true);
    }

public void lockInsertRows() {
        createProtectionFieldIfNotPresent();
        worksheet.getSheetProtection().setInsertRows(true);
    }

Has anyone faced problem related to specific user edit actions on locked sheet?

My suggestion is, these methods in XSSFSheet.java class should pass false to underlying API to work correctly.

I found one discussion on this issue at http://apache-poi.1045710.n5.nabble.com/POI-3-6-XSSFSheet-how-can-I-lock-specific-user-edit-actions-on-a-given-sheet-td2312068.html#a2312081


Thanks,
Amol Shinde