Search in sources :

Example 1 with IndexRecord

use of org.apache.poi.hssf.record.IndexRecord in project poi by apache.

the class TestSheet method getDbCellRecordPos.

/**
	 * @return the value calculated for the position of the first DBCELL record for this sheet.
	 * That value is found on the IndexRecord.
	 */
private static int getDbCellRecordPos(InternalSheet sheet) {
    MyIndexRecordListener myIndexListener = new MyIndexRecordListener();
    sheet.visitContainedRecords(myIndexListener, 0);
    IndexRecord indexRecord = myIndexListener.getIndexRecord();
    int dbCellRecordPos = indexRecord.getDbcellAt(0);
    return dbCellRecordPos;
}
Also used : IndexRecord(org.apache.poi.hssf.record.IndexRecord)

Example 2 with IndexRecord

use of org.apache.poi.hssf.record.IndexRecord in project poi by apache.

the class TestSheet method testCreateSheet.

@Test
public void testCreateSheet() {
    // Check we're adding row and cell aggregates
    List<Record> records = new ArrayList<Record>();
    records.add(BOFRecord.createSheetBOF());
    records.add(new DimensionsRecord());
    records.add(createWindow2Record());
    records.add(EOFRecord.instance);
    InternalSheet sheet = createSheet(records);
    Record[] outRecs = getSheetRecords(sheet, 0);
    int pos = 0;
    assertTrue(outRecs[pos++] instanceof BOFRecord);
    assertTrue(outRecs[pos++] instanceof IndexRecord);
    assertTrue(outRecs[pos++] instanceof DimensionsRecord);
    assertTrue(outRecs[pos++] instanceof WindowTwoRecord);
    assertTrue(outRecs[pos++] instanceof EOFRecord);
}
Also used : EOFRecord(org.apache.poi.hssf.record.EOFRecord) ArrayList(java.util.ArrayList) StringRecord(org.apache.poi.hssf.record.StringRecord) GutsRecord(org.apache.poi.hssf.record.GutsRecord) MergeCellsRecord(org.apache.poi.hssf.record.MergeCellsRecord) DrawingRecord(org.apache.poi.hssf.record.DrawingRecord) NoteRecord(org.apache.poi.hssf.record.NoteRecord) Record(org.apache.poi.hssf.record.Record) ObjRecord(org.apache.poi.hssf.record.ObjRecord) EOFRecord(org.apache.poi.hssf.record.EOFRecord) RowRecord(org.apache.poi.hssf.record.RowRecord) ColumnInfoRecord(org.apache.poi.hssf.record.ColumnInfoRecord) WindowTwoRecord(org.apache.poi.hssf.record.WindowTwoRecord) EscherDggRecord(org.apache.poi.ddf.EscherDggRecord) TextObjectRecord(org.apache.poi.hssf.record.TextObjectRecord) IndexRecord(org.apache.poi.hssf.record.IndexRecord) BOFRecord(org.apache.poi.hssf.record.BOFRecord) NumberRecord(org.apache.poi.hssf.record.NumberRecord) MulBlankRecord(org.apache.poi.hssf.record.MulBlankRecord) UncalcedRecord(org.apache.poi.hssf.record.UncalcedRecord) DimensionsRecord(org.apache.poi.hssf.record.DimensionsRecord) BlankRecord(org.apache.poi.hssf.record.BlankRecord) FormulaRecord(org.apache.poi.hssf.record.FormulaRecord) DimensionsRecord(org.apache.poi.hssf.record.DimensionsRecord) BOFRecord(org.apache.poi.hssf.record.BOFRecord) WindowTwoRecord(org.apache.poi.hssf.record.WindowTwoRecord) IndexRecord(org.apache.poi.hssf.record.IndexRecord) Test(org.junit.Test)

Aggregations

IndexRecord (org.apache.poi.hssf.record.IndexRecord)2 ArrayList (java.util.ArrayList)1 EscherDggRecord (org.apache.poi.ddf.EscherDggRecord)1 BOFRecord (org.apache.poi.hssf.record.BOFRecord)1 BlankRecord (org.apache.poi.hssf.record.BlankRecord)1 ColumnInfoRecord (org.apache.poi.hssf.record.ColumnInfoRecord)1 DimensionsRecord (org.apache.poi.hssf.record.DimensionsRecord)1 DrawingRecord (org.apache.poi.hssf.record.DrawingRecord)1 EOFRecord (org.apache.poi.hssf.record.EOFRecord)1 FormulaRecord (org.apache.poi.hssf.record.FormulaRecord)1 GutsRecord (org.apache.poi.hssf.record.GutsRecord)1 MergeCellsRecord (org.apache.poi.hssf.record.MergeCellsRecord)1 MulBlankRecord (org.apache.poi.hssf.record.MulBlankRecord)1 NoteRecord (org.apache.poi.hssf.record.NoteRecord)1 NumberRecord (org.apache.poi.hssf.record.NumberRecord)1 ObjRecord (org.apache.poi.hssf.record.ObjRecord)1 Record (org.apache.poi.hssf.record.Record)1 RowRecord (org.apache.poi.hssf.record.RowRecord)1 StringRecord (org.apache.poi.hssf.record.StringRecord)1 TextObjectRecord (org.apache.poi.hssf.record.TextObjectRecord)1