首页 新闻 会员 周边

POI导出带有密码的excel表格

0
悬赏园豆:10 [已关闭问题] 关闭于 2017-03-22 12:50

如何用POI导出带有密码的excel的表格(打开excel需要密码)

public static void main(String[] args) throws Exception{

  HSSFWorkbook wb = new HSSFWorkbook();
  HSSFSheet sheet = wb.createSheet("11");
  HSSFRow row = sheet.createRow(0);
  HSSFCell cell = row.createCell(0);
  cell.setCellValue("各种值");


  FileOutputStream fos = null;
  String filePath = "d:\\3.xls";
  File file = new File(filePath);
  if(file.exists()){
    //导出具体路径
    fos = new FileOutputStream(file);
   }else{
    file.createNewFile();
    //导出具体路径
    fos = new FileOutputStream(file);
  }
  wb.write(fos);
  fos.close();
}

飘飘城的主页 飘飘城 | 初学一级 | 园豆:69
提问于:2017-03-10 14:42
< >
分享
所有回答(1)
0

那么在NPOI里面应该有参数设置密码吧,在EPPLUS里面是有的

Jeffcky | 园豆:2789 (老鸟四级) | 2017-03-10 23:17
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册