Package org.apache.poi.ss.usermodel

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


    final Row row = sheet.getRow(y);
    if (row != null)
    {
      return row;
    }
    return sheet.createRow(y);
  }

  protected abstract Sheet getSheet();

  protected boolean isHeaderFooterValid(final String left, final String center, final String right)
View Full Code Here


   
    int lineNumber = 0;
    for ( TableRow iLine : this.tableRowList )
    {
      //
      Row row = sheet.createRow( lineNumber++ );
     
      //
      int cellIndex = 0;
      for ( String iCellText : iLine )
      {
View Full Code Here

        if (_sheetsModified) {
            close();
        }
        Sheet sheet = getWorkbook(true).getSheet(name);
        int lastRowNum = getLastRowNum(sheet);
        Row row = sheet.createRow(lastRowNum + 1);
        return row;
    }

    private int getLastRowNum(Sheet sheet) {
        final int lastRowNum = sheet.getLastRowNum();
View Full Code Here

     */
    public void test50416LastRowNumber() {
       // Create the workbook with 1 sheet which contains 3 rows
       HSSFWorkbook workbook = new HSSFWorkbook();
       Sheet sheet = workbook.createSheet("Bug50416");
       Row row1 = sheet.createRow(0);
       Cell cellA_1 = row1.createCell(0,Cell.CELL_TYPE_STRING);
       cellA_1.setCellValue("Cell A,1");
       Row row2 = sheet.createRow(1);
       Cell cellA_2 = row2.createCell(0,Cell.CELL_TYPE_STRING);
       cellA_2.setCellValue("Cell A,2");
View Full Code Here

       HSSFWorkbook workbook = new HSSFWorkbook();
       Sheet sheet = workbook.createSheet("Bug50416");
       Row row1 = sheet.createRow(0);
       Cell cellA_1 = row1.createCell(0,Cell.CELL_TYPE_STRING);
       cellA_1.setCellValue("Cell A,1");
       Row row2 = sheet.createRow(1);
       Cell cellA_2 = row2.createCell(0,Cell.CELL_TYPE_STRING);
       cellA_2.setCellValue("Cell A,2");
       Row row3 = sheet.createRow(2);
       Cell cellA_3 = row3.createCell(0,Cell.CELL_TYPE_STRING);
       cellA_3.setCellValue("Cell A,3");
View Full Code Here

       Cell cellA_1 = row1.createCell(0,Cell.CELL_TYPE_STRING);
       cellA_1.setCellValue("Cell A,1");
       Row row2 = sheet.createRow(1);
       Cell cellA_2 = row2.createCell(0,Cell.CELL_TYPE_STRING);
       cellA_2.setCellValue("Cell A,2");
       Row row3 = sheet.createRow(2);
       Cell cellA_3 = row3.createCell(0,Cell.CELL_TYPE_STRING);
       cellA_3.setCellValue("Cell A,3");
      
       // Test the last Row number it currently correct
       assertEquals(2, sheet.getLastRowNum());
View Full Code Here

            }
        } else {
            sheetName = "Times";
        }
        Sheet sheet = workbook.createSheet(sheetName);
        Row header = sheet.createRow(0);
        header.createCell(0).setCellValue("locale");
        header.createCell(1).setCellValue("DisplayName");
        header.createCell(2).setCellValue("Excel " + styleName);
        header.createCell(3).setCellValue("java.text.DateFormat");
        header.createCell(4).setCellValue("Equals");
View Full Code Here

        header.createCell(6).setCellValue("Excel pattern");

        int rowNum = 1;
        for( Locale locale : DateFormat.getAvailableLocales() ) {
            try {
                Row row = sheet.createRow(rowNum++);
   
                row.createCell(0).setCellValue(locale.toString());
                row.createCell(1).setCellValue(locale.getDisplayName());
   
                DateFormat dateFormat;
View Full Code Here

        Workbook w = new XSSFWorkbook();
        Sheet s = w.createSheet();
        int i = 0;
        List<String> lst = readStrings("48936-strings.txt");
        for (String str : lst) {
            s.createRow(i++).createCell(0).setCellValue(str);
        }

        try {
            w = XSSFTestDataSamples.writeOutAndReadBack(w);
        } catch (POIXMLException e){
View Full Code Here

             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

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.