Package org.apache.poi.hssf.model

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


        setPropertiesFromWorkbook(workbook);
        int recOffset = workbook.getNumRecords();

        // 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){
View Full Code Here


    assertNotNull( "Row contains a value", record );
    assertTrue( "First record is a FormulaRecordsAggregate", ( record instanceof FormulaRecordAggregate ) );
  }

  private void constructValueRecord(List<Record> records) {
    RowBlocksReader rbr = new RowBlocksReader(new RecordStream(records, 0));
    SharedValueManager sfrh = rbr.getSharedFormulaManager();
    RecordStream rs = rbr.getPlainRecordStream();
    while(rs.hasNext()) {
      Record rec = rs.getNext();
      valueRecord.construct((CellValueRecordInterface)rec, rs, sfrh);
    }
  }
View Full Code Here

        new HeaderFooterRecord(HexRead.readFromString("9C 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C4 60 00 00 00 00 00 00 00 00")),
        new UserSViewEnd(HexRead.readFromString("01, 00")),

        EOFRecord.instance,
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);
    InternalSheet sheet;
    try {
      sheet = InternalSheet.createSheet(rs);
    } catch (RuntimeException e) {
      if (e.getMessage().equals("two Page Settings Blocks found in the same sheet")) {
View Full Code Here

        new DimensionsRecord(),
        new WindowTwoRecord(),
        new HeaderFooterRecord(HexRead.readFromString("9C 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C4 60 00 00 00 00 00 00 00 00")),
        EOFRecord.instance,
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);
    InternalSheet sheet = InternalSheet.createSheet(rs);

    RecordCollector rv = new RecordCollector();
    sheet.visitContainedRecords(rv, 0);
    Record[] outRecs = rv.getRecords();
View Full Code Here

        new DimensionsRecord(),
        createBottomMargin(0.787F),
        new WindowTwoRecord(),
        EOFRecord.instance,
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);

    InternalSheet sheet;
    try {
      sheet = InternalSheet.createSheet(rs);
    } catch (RuntimeException e) {
View Full Code Here

    // Hypothetical setup of PSB records which should cause POI to crash
    Record[] recs = {
        new HeaderRecord("&LSales Figures"),
        new HeaderRecord("&LInventory"),
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);

    try {
      new PageSettingsBlock(rs);
      throw new AssertionFailedError("Identified bug 47199b - duplicate PSB records should not be allowed");
    } catch (RecordFormatException e) {
View Full Code Here

    // initialise PSB with some records, but not the header / footer
    Record[] recs = {
        new HCenterRecord(),
        new VCenterRecord(),
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);
    PageSettingsBlock psb = new PageSettingsBlock(rs);

    // serialize the PSB to see what records come out
    RecordCollector rc = new RecordCollector();
    psb.visitContainedRecords(rc);
View Full Code Here

        new HCenterRecord(),
        new VCenterRecord(),
        plsA,
        plsB, contB1, contB2, // make sure continuing PLS is still OK
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);
    PageSettingsBlock psb;
    try {
      psb = new PageSettingsBlock(rs);
    } catch (RecordFormatException e) {
      if ("Duplicate PageSettingsBlock record (sid=0x4d)".equals(e.getMessage())) {
View Full Code Here

                new HeaderFooterRecord(HexRead.readFromString("9C 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 33 00 00 00 00 00 00 00 00")),
                new HeaderFooterRecord(HexRead.readFromString("9C 08 00 00 00 00 00 00 00 00 00 00 53 CE BD CC DE 38 44 45 97 C1 5C 89 F9 37 32 1B 34 33 00 00 00 00 00 00 00 00")),

                EOFRecord.instance,
        };
        RecordStream rs = new RecordStream(Arrays.asList(recs), 0);
        InternalSheet sheet;
        try {
            sheet = InternalSheet.createSheet(rs);
        } catch (RuntimeException e) {
            if (e.getMessage().equals("Duplicate PageSettingsBlock record (sid=0x89c)")) {
View Full Code Here

        setPropertiesFromWorkbook(workbook);
        int recOffset = workbook.getNumRecords();

        // convert all LabelRecord records to LabelSSTRecord
        convertLabelRecords(records, recOffset);
        RecordStream rs = new RecordStream(records, recOffset);
        while (rs.hasNext()) {
            try {
                InternalSheet sheet = InternalSheet.createSheet(rs);
                _sheets.add(new HSSFSheet(this, sheet));
            } catch (UnsupportedBOFType eb) {
                // Hopefully there's a supported one after this!
View Full Code Here

TOP

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

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.