Examples of sizeOfColArray()


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

        CTWorksheet cts = xs.getCTWorksheet();

        CTCols[] cols_s = cts.getColsArray();
        assertEquals(1, cols_s.length);
        CTCols cols = cols_s[0];
        assertEquals(1, cols.sizeOfColArray());
        CTCol col = cols.getColArray(0);

        // XML is 1 based, POI is 0 based
        assertEquals(2, col.getMin());
        assertEquals(2, col.getMax());
View Full Code Here

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

        sheet.setColumnWidth(3, 33 * 256);

        cols_s = cts.getColsArray();
        assertEquals(1, cols_s.length);
        cols = cols_s[0];
        assertEquals(2, cols.sizeOfColArray());

        col = cols.getColArray(0);
        assertEquals(2, col.getMin()); // POI 1
        assertEquals(2, col.getMax());
        assertEquals(22.0, col.getWidth(), 0.0);
View Full Code Here

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

        //<cols>
        //  <col min="1" max="5" width="15.77734375" customWidth="1"/>
        //</cols>

        //a span of columns [1,5]
        assertEquals(1, cols.sizeOfColArray());
        CTCol col = cols.getColArray(0);
        assertEquals(1, col.getMin());
        assertEquals(5, col.getMax());
        double swidth = 15.77734375; //width of columns in the span
        assertEquals(swidth, col.getWidth());
View Full Code Here

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

        //  <col min="4" max="4" customWidth="true" width="25.0" />
        //  <col min="5" max="5" customWidth="true" width="30.0" />
        //</cols>

        //now the span is splitted into 5 individual columns
        assertEquals(5, cols.sizeOfColArray());
        for (int i = 0; i < 5; i++) {
            assertEquals(cw[i]*256, sheet.getColumnWidth(i));
            assertEquals((double)cw[i], cols.getColArray(i).getWidth());
        }

View Full Code Here

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

        //serialize and check again
        wb = getTestDataProvider().writeOutAndReadBack(wb);
        sheet = wb.getSheetAt(0);
        cols = sheet.getCTWorksheet().getColsArray(0);
        assertEquals(5, cols.sizeOfColArray());
        for (int i = 0; i < 5; i++) {
            assertEquals(cw[i]*256, sheet.getColumnWidth(i));
            assertEquals((double)cw[i], cols.getColArray(i).getWidth());
        }
    }
View Full Code Here

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

     */
    public void test47804() {
        XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("47804.xlsx");
        XSSFSheet sheet = wb.getSheetAt(0);
        CTCols cols = sheet.getCTWorksheet().getColsArray(0);
        assertEquals(2, cols.sizeOfColArray());
        CTCol col;
        //<cols>
        //  <col min="2" max="4" width="12" customWidth="1"/>
        //  <col min="7" max="7" width="10.85546875" customWidth="1"/>
        //</cols>
View Full Code Here

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

        //  <col min="3" max="3" customWidth="true" width="12.0" hidden="true"/>
        //  <col min="4" max="4" customWidth="true" width="12.0"/>
        //  <col min="7" max="7" customWidth="true" width="10.85546875" hidden="true"/>
        //</cols>

        assertEquals(4, cols.sizeOfColArray());
        col = cols.getColArray(0);
        assertEquals(2, col.getMin());
        assertEquals(2, col.getMax());
        col = cols.getColArray(1);
        assertEquals(3, col.getMin());
View Full Code Here

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

     * 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

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

       assertEquals(2, pinkStyle.getIndex());

       // Starts empty
       assertEquals(1, s.getCTWorksheet().sizeOfColsArray());
       CTCols cols = s.getCTWorksheet().getColsArray(0);
       assertEquals(0, cols.sizeOfColArray());
      
       // Add some rows and columns
       XSSFRow r1 = s.createRow(0);
       XSSFRow r2 = s.createRow(1);
       r1.createCell(0);
View Full Code Here

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

       r2.createCell(0);
       r2.createCell(3);
      
       // Check no style is there
       assertEquals(1, s.getCTWorksheet().sizeOfColsArray());
       assertEquals(0, cols.sizeOfColArray());
      
       assertEquals(defaultStyle, s.getColumnStyle(0));
       assertEquals(defaultStyle, s.getColumnStyle(2));
       assertEquals(defaultStyle, s.getColumnStyle(3));
      
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.