Package bad.robot.excel.workbook

Examples of bad.robot.excel.workbook.PoiWorkbook


    }

    @Test
    public void replaceNonDateCellWithACell() throws IOException {
        Workbook workbook = getWorkbook("cellTypes.xls");
        PoiWorkbook sheet = new PoiWorkbook(workbook);
        Coordinate coordinate = coordinate(B, 2);

        assertThat(getCellForCoordinate(coordinate, workbook), equalTo(new DoubleCell(1001d)));
        sheet.replaceCell(coordinate, createDate(15, MARCH, 2012));

        assertThat(getCellForCoordinate(coordinate, workbook), equalTo(new DateCell(createDate(15, MARCH, 2012))));
        assertThat(getCellDataFormatAtCoordinate(coordinate, workbook), is("dd-MMM-yyyy"));
        assertThat("should not have affected a shared data format", getCellDataFormatAtCoordinate(coordinate(B, 7), workbook), is("General"));
    }
View Full Code Here


        StyleBuilder blue = aStyle().with(fill(foregroundColour(Blue))).with(fontSize("18")).with(fontColour(White));
        StyleBuilder yellow = aStyle().with(fill(foregroundColour(Yellow))).with(fontColour(White));
        Cell a1 = new StringCell("Blue", blue);
        Cell a2 = new StringCell("Yellow", yellow);
        Workbook workbook = getWorkbook("emptySheet.xlsx");
        PoiWorkbook sheet = new PoiWorkbook(workbook);
        sheet.replaceCell(coordinate(A, 1), a1);
        sheet.replaceCell(coordinate(A, 2), a2);
        OutputWorkbook.writeWorkbookToTemporaryFile(workbook, "exampleOfApplyColours");
    }
View Full Code Here

        HashMap<ColumnIndex, Cell> columns = new HashMap<ColumnIndex, Cell>();
        columns.put(column(A), cell);

        Row row = new Row(columns);

        PoiWorkbook editable = new PoiWorkbook(getWorkbook("emptySheet.xls")).appendRowToFirstSheet(row);

        assertThat(editable.workbook(), sameWorkbook(getWorkbook("sheetWithSingleCell.xls")));
    }
View Full Code Here

TOP

Related Classes of bad.robot.excel.workbook.PoiWorkbook

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.