Package org.apache.poi.hssf.model

Examples of org.apache.poi.hssf.model.InternalSheet


    @Test
    public void bug51675(){
        final List<Short> list = new ArrayList<Short>();
        HSSFWorkbook workbook = openSample("51675.xls");
        HSSFSheet sh = workbook.getSheetAt(0);
        InternalSheet ish = HSSFTestHelper.getSheetForTest(sh);
        PageSettingsBlock psb = (PageSettingsBlock) ish.getRecords().get(13);
        psb.visitContainedRecords(new RecordAggregate.RecordVisitor() {
            public void visitRecord(Record r) {
                list.add(r.getSid());
            }
        });
View Full Code Here


    //read in sample
    HSSFWorkbook book = HSSFTestDataSamples.openSampleWorkbook("Simple.xls");

    //check initial position
    HSSFSheet umSheet = book.getSheetAt(0);
    InternalSheet s = umSheet.getSheet();
    assertEquals("Initial active cell should be in col 0",
      (short) 0, s.getActiveCellCol());
    assertEquals("Initial active cell should be on row 1",
      1, s.getActiveCellRow());

    //modify position through HSSFCell
    HSSFCell cell = umSheet.createRow(3).createCell(2);
    cell.setAsActiveCell();
    assertEquals("After modify, active cell should be in col 2",
      (short) 2, s.getActiveCellCol());
    assertEquals("After modify, active cell should be on row 3",
      3, s.getActiveCellRow());

    //write book to temp file; read and verify that position is serialized
    book = HSSFTestDataSamples.writeOutAndReadBack(book);

    umSheet = book.getSheetAt(0);
    s = umSheet.getSheet();

    assertEquals("After serialize, active cell should be in col 2",
      (short) 2, s.getActiveCellCol());
    assertEquals("After serialize, active cell should be on row 3",
      3, s.getActiveCellRow());
  }
View Full Code Here

        // convert all LabelRecord records to LabelSSTRecord
        convertLabelRecords(records, recOffset);
        RecordStream rs = new RecordStream(records, recOffset);
        while (rs.hasNext()) {
            InternalSheet sheet = InternalSheet.createSheet(rs);
            _sheets.add(new HSSFSheet(this, sheet));
        }

        for (int i = 0 ; i < workbook.getNumNames() ; ++i){
            NameRecord nameRecord = workbook.getNameRecord(i);
View Full Code Here

        FormulaShifter shifter = FormulaShifter.createForRowShift(externSheetIndex, startRow, endRow, n);
        _sheet.updateFormulasAfterCellShift(shifter, externSheetIndex);

        int nSheets = _workbook.getNumberOfSheets();
        for(int i=0; i<nSheets; i++) {
            InternalSheet otherSheet = _workbook.getSheetAt(i).getSheet();
            if (otherSheet == this._sheet) {
                continue;
            }
            short otherExtSheetIx = _book.checkExternSheet(i);
            otherSheet.updateFormulasAfterCellShift(shifter, otherExtSheetIx);
        }
        _workbook.getWorkbook().updateNamesAfterCellShift(shifter);
    }
View Full Code Here

        // convert all LabelRecord records to LabelSSTRecord
        convertLabelRecords(records, recOffset);
        RecordStream rs = new RecordStream(records, recOffset);
        while (rs.hasNext()) {
            InternalSheet sheet = InternalSheet.createSheet(rs);
            _sheets.add(new HSSFSheet(this, sheet));
        }

        for (int i = 0 ; i < workbook.getNumNames() ; ++i){
            HSSFName name = new HSSFName(this, workbook.getNameRecord(i));
View Full Code Here

        FormulaShifter shifter = FormulaShifter.createForRowShift(externSheetIndex, startRow, endRow, n);
        _sheet.updateFormulasAfterCellShift(shifter, externSheetIndex);

        int nSheets = _workbook.getNumberOfSheets();
        for(int i=0; i<nSheets; i++) {
            InternalSheet otherSheet = _workbook.getSheetAt(i).getSheet();
            if (otherSheet == this._sheet) {
                continue;
            }
            short otherExtSheetIx = _book.checkExternSheet(i);
            otherSheet.updateFormulasAfterCellShift(shifter, otherExtSheetIx);
        }
        _workbook.getWorkbook().updateNamesAfterCellShift(shifter);
    }
View Full Code Here

    assertEquals(0, countFR);
    assertEquals(0, countFRH);
   
    // Now check on the sheet
    HSSFSheet s = hssf.getSheetAt(0);
    InternalSheet sheet = HSSFTestHelper.getSheetForTest(s);
   
    for(RecordBase rb : sheet.getRecords()) {
      if(rb instanceof Record) {
        Record r = (Record)rb;
        if(r instanceof FeatRecord) {
          countFR++;
        } else if (r.getSid() == FeatRecord.sid) {
View Full Code Here

    assertEquals(0, countFR);
    assertEquals(0, countFRH);
   
    // Now find it on our sheet
    HSSFSheet s = hssf.getSheetAt(0);
    InternalSheet sheet = HSSFTestHelper.getSheetForTest(s);
   
    for(RecordBase rb : sheet.getRecords()) {
      if(rb instanceof Record) {
        Record r = (Record)rb;
        if(r instanceof FeatRecord) {
          fr = (FeatRecord)r;
          countFR++;
View Full Code Here

        FormulaShifter shifter = FormulaShifter.createForRowShift(externSheetIndex, startRow, endRow, n);
        _sheet.updateFormulasAfterCellShift(shifter, externSheetIndex);

        int nSheets = _workbook.getNumberOfSheets();
        for (int i = 0; i < nSheets; i++) {
            InternalSheet otherSheet = _workbook.getSheetAt(i).getSheet();
            if (otherSheet == this._sheet) {
                continue;
            }
            short otherExtSheetIx = _book.checkExternSheet(i);
            otherSheet.updateFormulasAfterCellShift(shifter, otherExtSheetIx);
        }
        _workbook.getWorkbook().updateNamesAfterCellShift(shifter);
    }
View Full Code Here

        // convert all LabelRecord records to LabelSSTRecord
        convertLabelRecords(records, recOffset);
        RecordStream rs = new RecordStream(records, recOffset);
        while (rs.hasNext()) {
            InternalSheet sheet = InternalSheet.createSheet(rs);
            _sheets.add(new HSSFSheet(this, sheet));
        }

        for (int i = 0 ; i < workbook.getNumNames() ; ++i){
            NameRecord nameRecord = workbook.getNameRecord(i);
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.model.InternalSheet

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.