Package org.openxmlformats.schemas.spreadsheetml.x2006.main

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet


        this.sheets.add(wrapper);
        return wrapper;
    }

  private CTSheet addSheet(String sheetname) {
    CTSheet sheet = workbook.getSheets().addNewSheet();
        if (sheetname != null) {
            sheet.setName(sheetname);
        }
    return sheet;
  }
View Full Code Here


        int idx = getSheetIndex(sheetname);
        sheets.add(pos, sheets.remove(idx));
        // Reorder CTSheets
        XmlObject cts = this.workbook.getSheets().getSheetArray(idx).copy();
        this.workbook.getSheets().removeSheet(idx);
        CTSheet newcts = this.workbook.getSheets().insertNewSheet(pos);
        newcts.set(cts);
    }
View Full Code Here

    }

    private CTSheet addSheet(String sheetname) {
        validateSheetName(sheetname);

        CTSheet sheet = workbook.getSheets().addNewSheet();
        sheet.setName(sheetname);
        return sheet;
    }
View Full Code Here

        int idx = getSheetIndex(sheetname);
        sheets.add(pos, sheets.remove(idx));
        // Reorder CTSheets
        XmlObject cts = workbook.getSheets().getSheetArray(idx).copy();
        workbook.getSheets().removeSheet(idx);
        CTSheet newcts = workbook.getSheets().insertNewSheet(pos);
        newcts.set(cts);
    }
View Full Code Here

     * @return True if sheet is hidden
     * @throws IllegalArgumentException if sheetIx is invalid
     */
    public boolean isSheetHidden(int sheetIx) {
        validateSheetIndex(sheetIx);
        CTSheet ctSheet = sheets.get(sheetIx).sheet;
        return ctSheet.getState() == STSheetState.HIDDEN;
    }
View Full Code Here

     * @return True if sheet is very hidden
     * @throws IllegalArgumentException if sheetIx is invalid
     */
    public boolean isSheetVeryHidden(int sheetIx) {
        validateSheetIndex(sheetIx);
        CTSheet ctSheet = sheets.get(sheetIx).sheet;
        return ctSheet.getState() == STSheetState.VERY_HIDDEN;
    }
View Full Code Here

     * @param hidden True to mark the sheet as hidden, false otherwise
     * @throws IllegalArgumentException if sheetIx is invalid
     */
    public void setSheetHidden(int sheetIx, boolean hidden) {
        validateSheetIndex(sheetIx);
        CTSheet ctSheet = sheets.get(sheetIx).sheet;
        ctSheet.setState(hidden ? STSheetState.HIDDEN : STSheetState.VISIBLE);
    }
View Full Code Here

     * @param hidden 0 for not hidden, 1 for hidden, 2 for very hidden
     * @throws IllegalArgumentException if sheetIx is invalid
     */
    public void setSheetHidden(int sheetIx, int hidden) {
        validateSheetIndex(sheetIx);
        CTSheet ctSheet = sheets.get(sheetIx).sheet;
        ctSheet.setState(STSheetState.Enum.forInt(hidden));
    }
View Full Code Here

     */
    public XSSFSheet createSheet(String sheetname) {
        if (containsSheet( sheetname, sheets.size() ))
               throw new IllegalArgumentException( "The workbook already contains a sheet of this name");

        CTSheet sheet = addSheet(sheetname);

        int sheetNumber = getNumberOfSheets() + 1;
        XSSFSheet wrapper = (XSSFSheet)createRelationship(XSSFRelation.WORKSHEET, XSSFFactory.getInstance(), sheetNumber);
        wrapper.sheet = sheet;
        sheet.setId(wrapper.getPackageRelationship().getId());
        sheet.setSheetId(sheetNumber);
        if(sheets.size() == 0) wrapper.setSelected(true);
        sheets.add(wrapper);
        return wrapper;
    }
View Full Code Here

        assertNull(columnHelper.getColumn(30, false));
    }
   
    public void testGetSetColDefaultStyle() {
        XSSFWorkbook workbook = new XSSFWorkbook();
        CTSheet ctSheet = CTSheet.Factory.newInstance();
        CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
        XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, workbook);
        ColumnHelper columnHelper = sheet.getColumnHelper();
       
        // POI column 3, OOXML column 4
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet

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.