PHPExcel protect chart from drag and drop, and cut

扶醉桌前 提交于 2019-12-23 04:08:30

问题


I used PHPExcel to generate chart and i done it, also i have protected (read only) the file. But now i want to avoid from dragging of chart and also the cut option should be disabled or user should not be able to cut the chart. For any help thanks.


回答1:


This code protects all objects in workbook - including charts:

$workbook->getActiveSheet()->getProtection()->setObjects(true);

Tested on PHPExcel 1.8.0.



来源:https://stackoverflow.com/questions/23578608/phpexcel-protect-chart-from-drag-and-drop-and-cut

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!