点击查看代码
XSSFWorkbook wb = new new XSSFWorkbook();
wb.setForceFormulaRecalculation(true);
OutputStream os = response.getOutputStream();
EncryptionInfo info = new EncryptionInfo(EncryptionMode.standard);
Encryptor enc = info.getEncryptor();
enc.confirmPassword("123456");
POIFSFileSystem poifsFileSystem = new POIFSFileSystem();
OutputStream encryptOutPutStream = enc.getDataStream(poifsFileSystem);
wb.write(encryptOutPutStream);
encryptOutPutStream.close();
poifsFileSystem.writeFilesystem(os);
wb.close();
浙公网安备 33010602011771号