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

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCols.sizeOfColArray()


        CTCols cols = worksheet.getColsArray(0);
        // Find the end of the group.
        CTCol columnInfo = cols.getColArray(colInfoIndex);
        int level = columnInfo.getOutlineLevel();
        int idx = colInfoIndex;
        while (idx < cols.sizeOfColArray() - 1) {
            CTCol nextColumnInfo = cols.getColArray(idx + 1);
            if (!isAdjacentBefore(columnInfo, nextColumnInfo)) {
                break;
            }
            if (nextColumnInfo.getOutlineLevel() < level) {
View Full Code Here


        CTCols cols = worksheet.getColsArray(0);
        // Look out outline details of end
        int endLevel = 0;
        boolean endHidden = false;
        int endOfOutlineGroupIdx = findEndOfColumnOutlineGroup(idx);
        if (endOfOutlineGroupIdx < cols.sizeOfColArray()) {
            CTCol nextInfo = cols.getColArray(endOfOutlineGroupIdx + 1);
            if (isAdjacentBefore(cols.getColArray(endOfOutlineGroupIdx),
                    nextInfo)) {
                endLevel = nextInfo.getOutlineLevel();
                endHidden = nextInfo.getHidden();
View Full Code Here

        if (fromColInfoIdx < 0) {
            throw new IllegalArgumentException(
                    "fromIdx parameter out of range: " + fromColInfoIdx);
        }

        for (int k = fromColInfoIdx; k < cols.sizeOfColArray(); k++) {
            CTCol ci = cols.getColArray(k);

            if (containsColumn(ci, columnValue)) {
                return k;
            }
View Full Code Here

     */
    private boolean isColumnGroupCollapsed(int idx) {
        CTCols cols = worksheet.getColsArray(0);
        int endOfOutlineGroupIdx = findEndOfColumnOutlineGroup(idx);
        int nextColInfoIx = endOfOutlineGroupIdx + 1;
        if (nextColInfoIx >= cols.sizeOfColArray()) {
            return false;
        }
        CTCol nextColInfo = cols.getColArray(nextColInfoIx);

        CTCol col = cols.getColArray(endOfOutlineGroupIdx);
View Full Code Here

    protected void write(OutputStream out) throws IOException {
      boolean setToNull = false;
        if(worksheet.sizeOfColsArray() == 1) {
          CTCols col = worksheet.getColsArray(0);
            if(col.sizeOfColArray() == 0) {
              setToNull = true;
              // this is necessary so that we do not write an empty <cols/> item into the sheet-xml in the xlsx-file
              // Excel complains about a corrupted file if this shows up there!
                worksheet.setColsArray(null);
            } else {
View Full Code Here

     * POI default is 0 based, but the file stores
     *  as 1 based.
     */
    public CTCol getColumn1Based(long index1, boolean splitColumns) {
        CTCols colsArray = worksheet.getColsArray(0);
        for (int i = 0; i < colsArray.sizeOfColArray(); i++) {
            CTCol colArray = colsArray.getColArray(i);
            if (colArray.getMin() <= index1 && colArray.getMax() >= index1) {
                if (splitColumns) {
                    if (colArray.getMin() < index1) {
                        insertCol(colsArray, colArray.getMin(), (index1 - 1), new CTCol[]{colArray});
View Full Code Here

        //one level
        sheet.groupColumn(2, 7);
        sheet.groupColumn(10, 11);
        CTCols cols = sheet.getCTWorksheet().getColsArray(0);
        assertEquals(2, cols.sizeOfColArray());
        List<CTCol> colArray = cols.getColList();
        assertNotNull(colArray);
        assertEquals(2 + 1, colArray.get(0).getMin()); // 1 based
        assertEquals(7 + 1, colArray.get(0).getMax()); // 1 based
        assertEquals(1, colArray.get(0).getOutlineLevel());
View Full Code Here

        assertEquals(1, colArray.get(0).getOutlineLevel());

        //two level
        sheet.groupColumn(1, 2);
        cols = sheet.getCTWorksheet().getColsArray(0);
        assertEquals(4, cols.sizeOfColArray());
        colArray = cols.getColList();
        assertEquals(2, colArray.get(1).getOutlineLevel());

        //three level
        sheet.groupColumn(6, 8);
View Full Code Here

        //three level
        sheet.groupColumn(6, 8);
        sheet.groupColumn(2, 3);
        cols = sheet.getCTWorksheet().getColsArray(0);
        assertEquals(7, cols.sizeOfColArray());
        colArray = cols.getColList();
        assertEquals(3, colArray.get(1).getOutlineLevel());
        assertEquals(3, sheet.getCTWorksheet().getSheetFormatPr().getOutlineLevelCol());

        sheet.ungroupColumn(8, 10);
View Full Code Here

    public void setColumnGroupCollapsed(){
        Workbook wb = new XSSFWorkbook();
        XSSFSheet sheet1 =(XSSFSheet) wb.createSheet();

        CTCols cols=sheet1.getCTWorksheet().getColsArray(0);
        assertEquals(0,cols.sizeOfColArray());

        sheet1.groupColumn( (short)4, (short)7 );
        sheet1.groupColumn( (short)9, (short)12 );

        assertEquals(2,cols.sizeOfColArray());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.