Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.Workbook.createSheet()


    }

    @Test
    public void getSetColumnHiddenShort() {
        Workbook workbook = new HSSFWorkbook();
        Sheet sheet = workbook.createSheet("Sheet 1");
        sheet.setColumnHidden((short)2, true);
        assertTrue(sheet.isColumnHidden((short)2));
    }

    @Test
View Full Code Here


    }

    @Test
    public void showInPane() {
        Workbook wb = new HSSFWorkbook();
        Sheet sheet = wb.createSheet();
        sheet.showInPane(2, 3);
       
        thrown.expect(IllegalArgumentException.class);
        thrown.expectMessage("Maximum row number is 65535");
      sheet.showInPane(Integer.MAX_VALUE, 3);
View Full Code Here

     * =IFERROR(55/0,\"Error in calculation\")"    Divides 55 by 0 and returns the error text
     * =IFERROR(C1,\"Error in calculation\")"      References the result of dividing 55 by 0 and returns the error text
     */
    public static void testEvaluate(){
        Workbook wb = new HSSFWorkbook();
        Sheet sh = wb.createSheet();
        Row row1 = sh.createRow(0);
        Row row2 = sh.createRow(1);

        // Create cells
        row1.createCell(0, Cell.CELL_TYPE_NUMERIC);
View Full Code Here

     *  better should really review this!
     */
    @Test
    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 );
View Full Code Here

     *  better should really review this!
     */
    @Test
    public void setRowGroupCollapsed(){
        Workbook wb = new XSSFWorkbook();
        XSSFSheet sheet1 = (XSSFSheet)wb.createSheet();

        sheet1.groupRow( 5, 14 );
        sheet1.groupRow( 7, 14 );
        sheet1.groupRow( 16, 19 );

View Full Code Here

        }
    }

    public void testXmlEncoding(){
        Workbook wb = _testDataProvider.createWorkbook();
        Sheet sh = wb.createSheet();
        Row row = sh.createRow(0);
        Cell cell = row.createCell(0);
        String sval = "\u0000\u0002\u0012<>\t\n\u00a0 &\"POI\'\u2122";
        cell.setCellValue(sval);
View Full Code Here

    }

    public void testEncodingbeloAscii(){
        Workbook xwb = new XSSFWorkbook();
        Cell xCell = xwb.createSheet().createRow(0).createCell(0);

        Workbook swb = SXSSFITestDataProvider.instance.createWorkbook();
        Cell sCell = swb.createSheet().createRow(0).createCell(0);

        StringBuffer sb = new StringBuffer();
View Full Code Here

    public void testEncodingbeloAscii(){
        Workbook xwb = new XSSFWorkbook();
        Cell xCell = xwb.createSheet().createRow(0).createCell(0);

        Workbook swb = SXSSFITestDataProvider.instance.createWorkbook();
        Cell sCell = swb.createSheet().createRow(0).createCell(0);

        StringBuffer sb = new StringBuffer();
        // test all possible characters
        for(int i = 0; i < Character.MAX_VALUE; i++) sb.append((char)i) ;
View Full Code Here

                "\nPOI",
                "\n\nPOI \n",
        };
        for(String str : samplesWithSpaces){
            Workbook swb = new SXSSFWorkbook();
            Cell sCell = swb.createSheet().createRow(0).createCell(0);
            sCell.setCellValue(str);
            assertEquals(sCell.getStringCellValue(), str);

            // read back as XSSF and check that xml:spaces="preserve" is set
            XSSFWorkbook xwb = (XSSFWorkbook)SXSSFITestDataProvider.instance.writeOutAndReadBack(swb);
View Full Code Here

        }
    }

    public void testBug55658SetNumericValue(){
        Workbook wb = new SXSSFWorkbook();
        Sheet sh = wb.createSheet();
        Row row = sh.createRow(0);
        Cell cell = row.createCell(0);
        cell.setCellValue(Integer.valueOf(23));
       
        cell.setCellValue("some");
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.