Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.Sheet.createRow()


             new HSSFWorkbook(),
             new XSSFWorkbook()
       };
       for(Workbook wb : wbs) {
          Sheet s = wb.createSheet();
          Row r = s.createRow(0);
         
          // Setup
          Cell cn = r.createCell(0, Cell.CELL_TYPE_NUMERIC);
          cn.setCellValue(1.2);
          Cell cs = r.createCell(1, Cell.CELL_TYPE_STRING);
View Full Code Here


    @Test
    public void addToExistingWorkbook() {
      XSSFWorkbook xssfWorkbook = new XSSFWorkbook();
      xssfWorkbook.createSheet("S1");
      Sheet sheet = xssfWorkbook.createSheet("S2");
      Row row = sheet.createRow(1);
      Cell cell = row.createCell(1);
      cell.setCellValue("value 2_1_1");
      SXSSFWorkbook wb = new SXSSFWorkbook(xssfWorkbook);
      xssfWorkbook = (XSSFWorkbook) SXSSFITestDataProvider.instance.writeOutAndReadBack(wb);
        assertTrue(wb.dispose());
View Full Code Here

        wb = new SXSSFWorkbook(xssfWorkbook);

      // Add a row to the existing empty sheet
      Sheet sheet1 = wb.getSheetAt(0);
      Row row1_1 = sheet1.createRow(1);
      Cell cell1_1_1 = row1_1.createCell(1);
      cell1_1_1.setCellValue("value 1_1_1");

      // Add a row to the existing non-empty sheet
      Sheet sheet2 = wb.getSheetAt(1);
View Full Code Here

      Cell cell1_1_1 = row1_1.createCell(1);
      cell1_1_1.setCellValue("value 1_1_1");

      // Add a row to the existing non-empty sheet
      Sheet sheet2 = wb.getSheetAt(1);
      Row row2_2 = sheet2.createRow(2);
      Cell cell2_2_1 = row2_2.createCell(1);
      cell2_2_1.setCellValue("value 2_2_1");

      // Add a sheet with one row
      Sheet sheet3 = wb.createSheet("S3");
View Full Code Here

      Cell cell2_2_1 = row2_2.createCell(1);
      cell2_2_1.setCellValue("value 2_2_1");

      // Add a sheet with one row
      Sheet sheet3 = wb.createSheet("S3");
      Row row3_1 = sheet3.createRow(1);
      Cell cell3_1_1 = row3_1.createCell(1);
      cell3_1_1.setCellValue("value 3_1_1");

      xssfWorkbook = (XSSFWorkbook) SXSSFITestDataProvider.instance.writeOutAndReadBack(wb);
      assertEquals(3, xssfWorkbook.getNumberOfSheets());
View Full Code Here

        int rowNum = 1000;
        int sheetNum = 5;
        for(int i = 0; i < sheetNum; i++){
            Sheet sh = wb.createSheet("sheet" + i);
            for(int j = 0; j < rowNum; j++){
                Row row = sh.createRow(j);
                Cell cell1 = row.createCell(0);
                cell1.setCellValue(new CellReference(cell1).formatAsString());

                Cell cell2 = row.createCell(1);
                cell2.setCellValue(i);
View Full Code Here

        int rowNum = 1000;
        int sheetNum = 5;
        for(int i = 0; i < sheetNum; i++){
            Sheet sh = wb.createSheet("sheet" + i);
            for(int j = 0; j < rowNum; j++){
                Row row = sh.createRow(j);
                Cell cell1 = row.createCell(0);
                cell1.setCellValue(new CellReference(cell1).formatAsString());

                Cell cell2 = row.createCell(1);
                cell2.setCellValue(i);
View Full Code Here

  }

  private static void populateWorkbook(Workbook wb) {
    Sheet sh = wb.createSheet();
    for (int rownum = 0; rownum < 100; rownum++) {
      Row row = sh.createRow(rownum);
      for (int cellnum = 0; cellnum < 10; cellnum++) {
        Cell cell = row.createCell(cellnum);
        String address = new CellReference(cell).formatAsString();
        cell.setCellValue(address);
      }
View Full Code Here

    }
   
    public void test56170Reproduce() throws IOException {
        final Workbook wb = new XSSFWorkbook();
        final Sheet sheet = wb.createSheet();
        Row row = sheet.createRow(0);
       
        // by creating Cells out of order we trigger the handling in onDocumentWrite()
        Cell cell1 = row.createCell(1);
        Cell cell2 = row.createCell(0);
View Full Code Here

    @Test
    public void overrideFlushedRows() {
        Workbook wb = new SXSSFWorkbook(3);
        Sheet sheet = wb.createSheet();

        sheet.createRow(1);
        sheet.createRow(2);
        sheet.createRow(3);
        sheet.createRow(4);

        thrown.expect(Throwable.class);
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.