Package org.apache.poi.hssf.record

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


  }

  public int checkExternSheet(int sheetIndex) {
    int thisWbIndex = -1; // this is probably always zero
    for (int i=0; i<_externalBookBlocks.length; i++) {
      SupBookRecord ebr = _externalBookBlocks[i].getExternalBookRecord();
      if (ebr.isInternalReferences()) {
        thisWbIndex = i;
        break;
      }
    }
    if (thisWbIndex < 0) {
View Full Code Here


        int extBlockIndex = -1;
        ExternalBookBlock extBlock = null;

        // find ExternalBlock for Add-In functions and remember its index
        for (int i = 0; i < _externalBookBlocks.length; i++) {
            SupBookRecord ebr = _externalBookBlocks[i].getExternalBookRecord();
            if (ebr.isAddInFunctions()) {
                extBlock = _externalBookBlocks[i];
                extBlockIndex = i;
                break;
            }
        }
View Full Code Here

   * @param newUrl The URL replacement
   * @return true if the oldUrl was found and replaced with newUrl. Otherwise false
   */
  public boolean changeExternalReference(String oldUrl, String newUrl) {
    for(ExternalBookBlock ex : _externalBookBlocks) {
      SupBookRecord externalRecord = ex.getExternalBookRecord();
      if (externalRecord.isExternalReferences()
        && externalRecord.getURL().equals(oldUrl)) {
       
        externalRecord.setURL(newUrl);
        return true;
      }
    }
    return false;
  }
View Full Code Here

    _externSheetRecord = new ExternSheetRecord();
    _recordCount = 2;

    // tell _workbookRecordList about the 2 new records

    SupBookRecord supbook = _externalBookBlocks[0].getExternalBookRecord();

    int idx = findFirstRecordLocBySid(CountryRecord.sid);
    if(idx < 0) {
      throw new RuntimeException("CountryRecord not found");
    }
View Full Code Here

    return lastName.getSheetNumber() == firstName.getSheetNumber();
  }

  public String[] getExternalBookAndSheetName(int extRefIndex) {
    int ebIx = _externSheetRecord.getExtbookIndexFromRefIndex(extRefIndex);
    SupBookRecord ebr = _externalBookBlocks[ebIx].getExternalBookRecord();
    if (!ebr.isExternalReferences()) {
      return null;
    }
    // Sheet name only applies if not a global reference
    int shIx1 = _externSheetRecord.getFirstSheetIndexFromRefIndex(extRefIndex);
        int shIx2 = _externSheetRecord.getLastSheetIndexFromRefIndex(extRefIndex);
    String firstSheetName = null;
        String lastSheetName = null;
    if(shIx1 >= 0) {
        firstSheetName = ebr.getSheetNames()[shIx1];
    }
    if (shIx2 >= 0) {
        lastSheetName = ebr.getSheetNames()[shIx2];
    }
    if (shIx1 == shIx2) {
        return new String[] {
            ebr.getURL(),
            firstSheetName
        };
    } else {
            return new String[] {
                    ebr.getURL(),
                    firstSheetName,
                    lastSheetName
            };
    }
  }
View Full Code Here

            };
    }
  }

  public int getExternalSheetIndex(String workbookName, String firstSheetName, String lastSheetName) {
    SupBookRecord ebrTarget = null;
    int externalBookIndex = -1;
    for (int i=0; i<_externalBookBlocks.length; i++) {
      SupBookRecord ebr = _externalBookBlocks[i].getExternalBookRecord();
      if (!ebr.isExternalReferences()) {
        continue;
      }
      if (workbookName.equals(ebr.getURL())) { // not sure if 'equals()' works when url has a directory
        ebrTarget = ebr;
        externalBookIndex = i;
        break;
      }
    }
View Full Code Here

      return checkExternSheet(sheetIndex, sheetIndex);
  }
    public int checkExternSheet(int firstSheetIndex, int lastSheetIndex) {
    int thisWbIndex = -1; // this is probably always zero
    for (int i=0; i<_externalBookBlocks.length; i++) {
      SupBookRecord ebr = _externalBookBlocks[i].getExternalBookRecord();
      if (ebr.isInternalReferences()) {
        thisWbIndex = i;
        break;
      }
    }
    if (thisWbIndex < 0) {
View Full Code Here

        int extBlockIndex = -1;
        ExternalBookBlock extBlock = null;

        // find ExternalBlock for Add-In functions and remember its index
        for (int i = 0; i < _externalBookBlocks.length; i++) {
            SupBookRecord ebr = _externalBookBlocks[i].getExternalBookRecord();
            if (ebr.isAddInFunctions()) {
                extBlock = _externalBookBlocks[i];
                extBlockIndex = i;
                break;
            }
        }
View Full Code Here

   * @param newUrl The URL replacement
   * @return true if the oldUrl was found and replaced with newUrl. Otherwise false
   */
  public boolean changeExternalReference(String oldUrl, String newUrl) {
    for(ExternalBookBlock ex : _externalBookBlocks) {
      SupBookRecord externalRecord = ex.getExternalBookRecord();
      if (externalRecord.isExternalReferences()
        && externalRecord.getURL().equals(oldUrl)) {
       
        externalRecord.setURL(newUrl);
        return true;
      }
    }
    return false;
  }
View Full Code Here

    _externSheetRecord = new ExternSheetRecord();
    _recordCount = 2;

    // tell _workbookRecordList about the 2 new records

    SupBookRecord supbook = _externalBookBlocks[0].getExternalBookRecord();

    int idx = findFirstRecordLocBySid(CountryRecord.sid);
    if(idx < 0) {
      throw new RuntimeException("CountryRecord not found");
    }
View Full Code Here

TOP

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

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.