Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.Row


    final SheetLayout sheetLayout = contentProducer.getSheetLayout();
    final int colCount = sheetLayout.getColumnCount();

    for (int row = startRow; row < finishRow; row++)
    {
      final Row hssfRow = getRowAt(row);
      final double lastRowHeight = StrictGeomUtility.toExternalValue(sheetLayout.getRowHeight(row));
      hssfRow.setHeightInPoints((float) (lastRowHeight));

      for (int col = 0; col < colCount; col++)
      {
        final CellMarker.SectionType sectionType = contentProducer.getSectionType(row, col);
        final RenderBox content = contentProducer.getContent(row, col);
View Full Code Here


    return true;
  }

  protected Cell getCellAt(final int x, final int y)
  {
    final Row row = getRowAt(y);
    final Cell cell = row.getCell(x);
    if (cell != null)
    {
      return cell;
    }
    return row.createCell(x);
  }
View Full Code Here

  }

  protected Row getRowAt(final int y)
  {
    Sheet sheet = getSheet();
    final Row row = sheet.getRow(y);
    if (row != null)
    {
      return row;
    }
    return sheet.createRow(y);
View Full Code Here

        CellRangeAddress[] mergedRanges = getMergedCells( sheet );
        DataFormatter formatter = new DataFormatter( Locale.ENGLISH );
        FormulaEvaluator formulaEvaluator = sheet.getWorkbook().getCreationHelper().createFormulaEvaluator();

        for ( int i = 0; i <= maxRows; i++ ) {
            Row row = sheet.getRow( i );
            int lastCellNum = row != null ? row.getLastCellNum() : 0;
            newRow( listeners, i, lastCellNum );

            for ( int cellNum = 0; cellNum < lastCellNum; cellNum++ ) {
                Cell cell = row.getCell( cellNum );
                if ( cell == null ) {
                    continue;
                }
                double num = 0;
View Full Code Here

   *@param rowIndex The 0 based row number
   *@param sheet The sheet that the row is part of.
   *@return The row indicated by the rowCounter
   */
  public static Row getRow(int rowIndex, Sheet sheet) {
    Row row = sheet.getRow(rowIndex);
    if (row == null) {
      row = sheet.createRow(rowIndex);
    }
    return row;
  }
View Full Code Here

   
    int lineNumber = 0;
    for ( TableRow iLine : this.tableRowList )
    {
      //
      Row row = sheet.createRow( lineNumber++ );
     
      //
      int cellIndex = 0;
      for ( String iCellText : iLine )
      {
        Cell cell = row.createCell( cellIndex++ );
        cell.setCellValue( createHelper.createRichTextString( iCellText ) );
      }
    }
   
    try
View Full Code Here

    HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(wb);
    for(int i=0; i<wb.getNumberOfSheets(); i++) {
      HSSFSheet sheet = wb.getSheetAt(i);

      for (Iterator<Row> rit = sheet.rowIterator(); rit.hasNext();) {
        Row r = rit.next();

        for (Iterator<Cell> cit = r.cellIterator(); cit.hasNext();) {
          Cell c = cit.next();
          if (c.getCellType() == HSSFCell.CELL_TYPE_FORMULA)
            evaluator.evaluateFormulaCell(c);
        }
      }
View Full Code Here

      assertEquals(0, rows.size());

      // create 5x the amound of rows as the streaming sheet will hold in
      // memory
      for (int i = 0; i < windowSize * 5; i++) {
        Row row = sheet.createRow(i);
        Cell cell = row.createCell(0);
        cell.setCellValue("value" + i);

        assertTrue(rows.size() <= 1000);
      }

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;
    }
View Full Code Here

     * Vertically aligned text
     */
    public void test49524() throws Exception {
       HSSFWorkbook wb = openSample("49524.xls");
       Sheet s = wb.getSheetAt(0);
       Row r = s.getRow(0);
       Cell rotated = r.getCell(0);
       Cell normal = r.getCell(1);
      
       // Check the current ones
       assertEquals(0, normal.getCellStyle().getRotation());
       assertEquals(0xff, rotated.getCellStyle().getRotation());
      
       // Add a new style, also rotated
       CellStyle cs = wb.createCellStyle();
       cs.setRotation((short)0xff);
       Cell nc = r.createCell(2);
       nc.setCellValue("New Rotated Text");
       nc.setCellStyle(cs);
       assertEquals(0xff, nc.getCellStyle().getRotation());
      
       // Write out and read back
       wb = writeOutAndReadBack(wb);
      
       // Re-check
       s = wb.getSheetAt(0);
       r = s.getRow(0);
       rotated = r.getCell(0);
       normal = r.getCell(1);
       nc = r.getCell(2);
      
       assertEquals(0, normal.getCellStyle().getRotation());
       assertEquals(0xff, rotated.getCellStyle().getRotation());
       assertEquals(0xff, nc.getCellStyle().getRotation());
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.usermodel.Row

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.