Examples of CTWorkbook


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

    @Test
    public void recalcId() {
        XSSFWorkbook wb = new XSSFWorkbook();
        assertFalse(wb.getForceFormulaRecalculation());
        CTWorkbook ctWorkbook = wb.getCTWorkbook();
        assertFalse(ctWorkbook.isSetCalcPr());

        wb.setForceFormulaRecalculation(true); // resets the EngineId flag to zero

        CTCalcPr calcPr = ctWorkbook.getCalcPr();
        assertNotNull(calcPr);
        assertEquals(0, (int) calcPr.getCalcId());

        calcPr.setCalcId(100);
        assertTrue(wb.getForceFormulaRecalculation());
View Full Code Here

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

        return cs.toString().indexOf(searchChar.toString(), start);
    }

    public void testAddPivotCache() {
        XSSFWorkbook wb = new XSSFWorkbook();
        CTWorkbook ctWb = wb.getCTWorkbook();
        CTPivotCache pivotCache = wb.addPivotCache("0");
        //Ensures that pivotCaches is initiated
        assertTrue(ctWb.isSetPivotCaches());
        assertSame(pivotCache, ctWb.getPivotCaches().getPivotCacheList().get(0));
        assertEquals("0", pivotCache.getId());
    }
View Full Code Here

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

                        sheetMap.put(rel.getId(), wb.getPackage().getPart(relName));
                    }
                }
                //step 2. Read array of CTSheet elements, wrap it in a ArayList and construct an iterator
                //Note, using XMLBeans might be expensive, consider refactoring to use SAX or a plain regexp search
                CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
                sheetIterator = Arrays.asList(wbBean.getSheets().getSheetArray()).iterator();
            } catch (InvalidFormatException e){
                throw new POIXMLException(e);
            } catch (XmlException e){
                throw new POIXMLException(e);
            }
View Full Code Here

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

    assertSame(sheet2, workbook.getSheetAt(1));
    workbook.setSheetOrder("sheet2", 0);
    assertSame(sheet2, workbook.getSheetAt(0));
    assertSame(sheet1, workbook.getSheetAt(1));
    // Test reordering of CTSheets
    CTWorkbook ctwb = workbook.getCTWorkbook();
    CTSheet[] ctsheets = ctwb.getSheets().getSheetArray();
    assertEquals("sheet2", ctsheets[0].getName());
    assertEquals("sheet1", ctsheets[1].getName());
   
    // Borderline case: only one sheet
    workbook = new XSSFWorkbook();
View Full Code Here

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

                        sheetMap.put(rel.getId(), wb.getPackage().getPart(relName));
                    }
                }
                //step 2. Read array of CTSheet elements, wrap it in a ArayList and construct an iterator
                //Note, using XMLBeans might be expensive, consider refactoring to use SAX or a plain regexp search
                CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
                sheetIterator = Arrays.asList(wbBean.getSheets().getSheetArray()).iterator();
            } catch (InvalidFormatException e){
                throw new POIXMLException(e);
            } catch (XmlException e){
                throw new POIXMLException(e);
            }
View Full Code Here

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

        assertSame(sheet2, workbook.getSheetAt(1));
        workbook.setSheetOrder("sheet2", 0);
        assertSame(sheet2, workbook.getSheetAt(0));
        assertSame(sheet1, workbook.getSheetAt(1));
        // Test reordering of CTSheets
        CTWorkbook ctwb = workbook.getWorkbook();
        CTSheet[] ctsheets = ctwb.getSheets().getSheetArray();
        assertEquals("sheet2", ctsheets[0].getName());
        assertEquals("sheet1", ctsheets[1].getName());
       
        // Borderline case: only one sheet
        workbook = new XSSFWorkbook();
View Full Code Here

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

                        sheetMap.put(rel.getId(), wb.getPackage().getPart(relName));
                    }
                }
                //step 2. Read array of CTSheet elements, wrap it in a ArayList and construct an iterator
                //Note, using XMLBeans might be expensive, consider refactoring to use SAX or a plain regexp search
                CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
                sheetIterator = wbBean.getSheets().getSheetList().iterator();
            } catch (InvalidFormatException e){
                throw new POIXMLException(e);
            } catch (XmlException e){
                throw new POIXMLException(e);
            }
View Full Code Here

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

  }

    public void testRecalcId() {
        XSSFWorkbook wb = new XSSFWorkbook();
        assertFalse(wb.getForceFormulaRecalculation());
        CTWorkbook ctWorkbook = wb.getCTWorkbook();
        assertFalse(ctWorkbook.isSetCalcPr());

        wb.setForceFormulaRecalculation(true); // resets the EngineId flag to zero

        CTCalcPr calcPr = ctWorkbook.getCalcPr();
        assertNotNull(calcPr);
        assertEquals(0, (int) calcPr.getCalcId());

        calcPr.setCalcId(100);
        assertTrue(wb.getForceFormulaRecalculation());
View Full Code Here

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

                        sheetMap.put(rel.getId(), wb.getPackage().getPart(relName));
                    }
                }
                //step 2. Read array of CTSheet elements, wrap it in a ArayList and construct an iterator
                //Note, using XMLBeans might be expensive, consider refactoring to use SAX or a plain regexp search
                CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
                sheetIterator = wbBean.getSheets().getSheetList().iterator();
            } catch (InvalidFormatException e){
                throw new POIXMLException(e);
            } catch (XmlException e){
                throw new POIXMLException(e);
            }
View Full Code Here

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

                        sheetMap.put(rel.getId(), wb.getPackage().getPart(relName));
                    }
                }
                //step 2. Read array of CTSheet elements, wrap it in a ArayList and construct an iterator
                //Note, using XMLBeans might be expensive, consider refactoring to use SAX or a plain regexp search
                CTWorkbook wbBean = WorkbookDocument.Factory.parse(wb.getInputStream()).getWorkbook();
                sheetIterator = wbBean.getSheets().getSheetList().iterator();
            } catch (InvalidFormatException e){
                throw new POIXMLException(e);
            } catch (XmlException e){
                throw new POIXMLException(e);
            }
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.