php - Is there a function to lock column from being modified using Maatwebsite/Laravel-Excel? -
i want lock column prevent user edit data of column. maatwebsite/laravel-excel provide feature ?
what have tried,
$sheet->setfreeze('a2');
but, doesn't work. method wrong ?
i have used setfreeze()
method doesn't work case well.
i have thought problem in different way , here way,
- protect whole sheet.
- now remove protection areas need writable access. i.e. except a
here code.
$sheet->loadview('template'); $sheet->getprotection()->setpassword('password'); $sheet->getprotection()->setsheet(true);
now unprotect areas,
$sheet->getstyle('b1:d100')->getprotection()->setlocked(phpexcel_style_protection::protection_unprotected);
column protected since whole sheet protected, remove protection column b last column.
in case rectangular area b1 d100 editable. can customize according requirement.
hope understand.
Comments
Post a Comment