Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFDataValidation


            int firstCol,
            int lastCol) {
        //データの入力規則を設定するセルを設定する
        CellRangeAddressList addressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol);
        DVConstraint constraint = DVConstraint.createExplicitListConstraint(list);
        HSSFDataValidation validation = new HSSFDataValidation(addressList, constraint);
        validation.setEmptyCellAllowed(true);
        validation.setSuppressDropDownArrow(false);
        sheet.addValidationData(validation);
    }
View Full Code Here


        InputStream is = HSSFTestDataSamples.openSampleFileStream(XLS_FILENAME);
        HSSFWorkbook workbook = new HSSFWorkbook(is);

        CellRangeAddressList cellRange = new CellRangeAddressList(0, 0, 1, 1);
        DataValidationConstraint constraint = DVConstraint.createFormulaListConstraint(DV_DEFINITION);
        HSSFDataValidation dataValidation = new HSSFDataValidation(cellRange, constraint);

        // This used to throw an error before
        try {
            workbook.getSheet(SHEET_NAME).addValidationData(dataValidation);
        } catch (IllegalStateException ex) {
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.usermodel.HSSFDataValidation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.