//create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); CheckBoxCellType cellType = new CheckBoxCellType(); cellType.setCaption("Caption"); cellType.setTextTrue("True"); cellType.setTextFalse("False"); cellType.setTextIndeterminate("Indeterminate"); cellType.setIsThreeState(true); cellType.setTextAlign(CheckBoxAlign.Right); worksheet.getRange("C5:C6").setCellType(cellType); worksheet.getRange("C5").setValue(true); worksheet.getRange("C6").setValue(false); //save to an pdf file workbook.save("AddCheckBoxCellType.pdf");
//create a new workbook var workbook = Workbook() val worksheet = workbook.worksheets.get(0) val cellType = CheckBoxCellType() cellType.setCaption("Caption") cellType.setTextTrue("True") cellType.setTextFalse("False") cellType.setTextIndeterminate("Indeterminate") cellType.isThreeState = true cellType.textAlign = CheckBoxAlign.Right worksheet.getRange("C5:C6").cellType = cellType worksheet.getRange("C5").setValue(true) worksheet.getRange("C6").setValue(false) //save to an pdf file workbook.save("AddCheckBoxCellType.pdf")