1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > java保护表格_java poi Excel单元格保护

java保护表格_java poi Excel单元格保护

时间:2019-08-26 08:47:47

相关推荐

java保护表格_java poi Excel单元格保护

XSSFCellStyle style2 = workbook.createCellStyle(); //设置此style2为锁定 style2.setFillPattern(CellStyle.DIAMONDS); style2.setFillBackgroundColor(HSSFColor.GREY_40_PERCENT.index); style2.setLocked(true); //sheet表加密:等效excel的审阅菜单下的保护工作表 //sheet.protectSheet(new String("333"));//333是密码 //workbook.writeProtectWorkbook("abc", "abc"); sheet.enableLocking(); CTSheetProtection sheetProtection = sheet.getCTWorksheet().getSheetProtection(); sheetProtection.setSelectLockedCells(false); sheetProtection.setSelectUnlockedCells(false); sheetProtection.setFormatCells(true); sheetProtection.setFormatColumns(true); sheetProtection.setFormatRows(true); sheetProtection.setInsertColumns(true); sheetProtection.setInsertRows(false); sheetProtection.setInsertHyperlinks(true); sheetProtection.setDeleteColumns(true); sheetProtection.setDeleteRows(true); sheetProtection.setSort(false); sheetProtection.setAutoFilter(false); sheetProtection.setPivotTables(true); sheetProtection.setObjects(true); sheetProtection.setScenarios(true);

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。