After protected the sheet.
sheet.protectSheet("");
Not able to enable sorting.
The new version of POI. Not have an argument to enable the sortingin a protected sheet. It has only to disable sorting.
sheet.lockSort();
I tried this also.
CTSheetProtection sheetProtection = excelSheet.getCTWorksheet().getSheetProtection();
sheetProtection.setSort(false);
But this function enables the sorting button in excel sheet. But after I click the A-Z or Z-A I am getting the pop-up. Because of the sheet protection.
I am using this <version>3.10.1</version>
.
I am using a protection method for the user do not edit some column in sheet.
But I need sorting in a protected sheet.
One more question also. Is this possible to lock the first row of excel. Because do not sort the title row. But I used
sheet.createFreezePane(0, 1);
This will freeze from scrolling, not from the sorting. Please help with these two questions.