Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.RowRecord


     * @return RowRecord created for the passed in row number
     * @see org.apache.poi.hssf.record.RowRecord
     */
    public static RowRecord createRow(int row)
    {
        RowRecord rowrec = new RowRecord();

        //rowrec.setRowNumber(( short ) row);
        rowrec.setRowNumber(row);
        rowrec.setHeight(( short ) 0xff);
        rowrec.setOptimize(( short ) 0x0);
        rowrec.setOptionFlags(( short ) 0x100)// seems necessary for outlining
        rowrec.setXFIndex(( short ) 0xf);
        return rowrec;
    }
View Full Code Here


        if (!isRowGroupCollapsed(idx))
            return;

        // Find the start of the group.
        int startIdx = findStartOfRowOutlineGroup( idx );
        RowRecord row = getRow( startIdx );

        // Find the end of the group.
        int endIdx = findEndOfRowOutlineGroup( idx );

        // expand:
        // colapsed bit must be unset
        // hidden bit gets unset _if_ surrounding groups are expanded you can determine
        //   this by looking at the hidden bit of the enclosing group.  You will have
        //   to look at the start and the end of the current group to determine which
        //   is the enclosing group
        // hidden bit only is altered for this outline level.  ie.  don't uncollapse contained groups
        if ( !isRowGroupHiddenByParent( idx ) )
        {
            for ( int i = startIdx; i <= endIdx; i++ )
            {
                if ( row.getOutlineLevel() == getRow( i ).getOutlineLevel() )
                    getRow( i ).setZeroHeight( false );
                else if (!isRowGroupCollapsed(i))
                    getRow( i ).setZeroHeight( false );
            }
        }
View Full Code Here

            case BoundSheetRecord.sid:
                BoundSheetRecord bsr = (BoundSheetRecord) record;
                //System.out.println("New sheet named: " + bsr.getSheetname());
                break;
            case RowRecord.sid:
                RowRecord rowrec = (RowRecord) record;
                //System.out.println("Row " + rowrec.getRowNumber() + " found, first column at "
                //        + rowrec.getFirstCol() + " last column at " + rowrec.getLastCol());
               
                // If there's a jump in rows, fire off missing row records
                if(lastSeenRow+1 < rowrec.getRowNumber()) {
                  for(int i=(lastSeenRow+1); i<rowrec.getRowNumber(); i++) {
                    MissingRowDummyRecord dr = new MissingRowDummyRecord(i);
                    childListener.processRecord(dr);
                  }
                }
               
                // Record this as the last row we saw
                lastSeenRow = rowrec.getRowNumber();
                break;
               
               
            // These are all the "cell" records
               
View Full Code Here

    protected HSSFRow(HSSFWorkbook book, Sheet sheet, int rowNum)
    {
        this.rowNum = rowNum;
        this.book = book;
        this.sheet = sheet;
        row = new RowRecord();
        row.setOptionFlags( (short)0x100 );   // seems necessary for outlining to work. 
        row.setHeight((short) 0xff);
        row.setLastCol((short) -1);
        row.setFirstCol((short) -1);
View Full Code Here

   
    // We have rows 0, 1, 2, 20 and 21
    int row0 = -1;
    for(int i=0; i<r.length; i++) {
      if(r[i] instanceof RowRecord) {
        RowRecord rr = (RowRecord)r[i];
        if(rr.getRowNumber() == 0) { row0 = i; }
      }
    }
    assertTrue(row0 > -1);
   
    // Following row 0, we should have 1, 2, then dummy, then 20+21+22
    assertTrue(r[row0] instanceof RowRecord);
    assertTrue(r[row0+1] instanceof RowRecord);
    assertTrue(r[row0+2] instanceof RowRecord);
    assertTrue(r[row0+3] instanceof MissingRowDummyRecord);
    assertTrue(r[row0+4] instanceof MissingRowDummyRecord);
    assertTrue(r[row0+5] instanceof MissingRowDummyRecord);
    assertTrue(r[row0+6] instanceof MissingRowDummyRecord);
    // ...
    assertTrue(r[row0+18] instanceof MissingRowDummyRecord);
    assertTrue(r[row0+19] instanceof MissingRowDummyRecord);
    assertTrue(r[row0+20] instanceof RowRecord);
    assertTrue(r[row0+21] instanceof RowRecord);
    assertTrue(r[row0+22] instanceof RowRecord);
   
    // Check things had the right row numbers
    RowRecord rr;
    rr = (RowRecord)r[row0+2];
    assertEquals(2, rr.getRowNumber());
    rr = (RowRecord)r[row0+20];
    assertEquals(20, rr.getRowNumber());
    rr = (RowRecord)r[row0+21];
    assertEquals(21, rr.getRowNumber());
   
    MissingRowDummyRecord mr;
    mr = (MissingRowDummyRecord)r[row0+3];
    assertEquals(3, mr.getRowNumber());
    mr = (MissingRowDummyRecord)r[row0+4];
View Full Code Here

  public void testMovingMergedRegion() {
    List records = new ArrayList();
   
    MergeCellsRecord merged = new MergeCellsRecord();
    merged.addArea(0, (short)0, 1, (short)2);
    records.add(new RowRecord());
    records.add(new RowRecord());
    records.add(new RowRecord());
    records.add(merged);
   
    Sheet sheet = Sheet.createSheet(records, 0);
    sheet.records.remove(0);
   
View Full Code Here

   * Makes sure all rows registered for this sheet are aggregated, they were being skipped
   *
   */
  public void testRowAggregation() {
    List records = new ArrayList();
    RowRecord row = new RowRecord();
    row.setRowNumber(0);   
    records.add(row);
   
    row = new RowRecord();
    row.setRowNumber(1);
    records.add(row);

    records.add(new StringRecord());
   
    row = new RowRecord();
    row.setRowNumber(2);
    records.add(row);
   
   
    Sheet sheet = Sheet.createSheet(records, 0);
    assertNotNull("Row [2] was skipped", sheet.getRow(2));
View Full Code Here

     * @param sheet low-level Sheet object that contains this Row
     * @param rowNum the row number of this row (0 based)
     * @see org.apache.poi.hssf.usermodel.HSSFSheet#createRow(int)
     */
    HSSFRow(HSSFWorkbook book, HSSFSheet sheet, int rowNum) {
        this(book, sheet, new RowRecord(rowNum));
    }
View Full Code Here

    public RowRecord getRow(int rownum)
    {

        // Integer integer = new Integer(rownum);
        RowRecord row = new RowRecord();

        row.setRowNumber(( short ) rownum);
        return ( RowRecord ) records.get(row);
    }
View Full Code Here

    /** Performs a deep clone of the record*/
    public Object clone() {
      RowRecordsAggregate rec = new RowRecordsAggregate();
      for (Iterator rowIter = getIterator(); rowIter.hasNext();) {
        //return the cloned Row Record & insert
        RowRecord row = (RowRecord)((RowRecord)rowIter.next()).clone();
        rec.insertRow(row);
      }
      return rec;
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.RowRecord

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.