找回密码
 立即注册

QQ登录

只需一步,快速开始

Richard.HuangSpreadJS 开发认证
超级版主   /  发表于:2024-5-23 13:32:53
11#
Clint 发表于 2024-5-23 11:08
是否有办法在导出GcExcel中,隐藏部分单元格的公式(类似于Excel原生的密码保护单元格-不展示公式功能)
...

我们GcExcel暂时不支持类似Excel“允许区域编辑”的功能,而对于您不想用户解除隐藏行列,您可以通过工作表保护 + 不允许设置行列格式来实现:
代码:
  1. sheet.options.protectionOptions.formatColumns = false// 不允许设置列格式
  2. sheet.options.protectionOptions.formatRows= false// 不允许设置行格式
  3. sheet.options.isProtected = true// 工作表保护
复制代码
image.png840025329.png
GcExcel中对应的方法:
  1. IProtectionSettings protectionSettings = iWorksheet.getProtectionSettings();
  2. protectionSettings.setAllowFormattingColumns(false);
  3. protectionSettings.setAllowFormattingRows(false);
  4. iWorksheet.protect();
复制代码

回复 使用道具 举报
Richard.HuangSpreadJS 开发认证
超级版主   /  发表于:2024-5-24 16:15:36
12#
您好,请问楼主的问题是否得到解决,如果仍然存在问题,欢迎继续跟帖询问
回复 使用道具 举报
12
您需要登录后才可以回帖 登录 | 立即注册
返回顶部