Examples of ExtendedFormatRecord


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

     * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getCellStyleAt(short)
     */
    public HSSFCellStyle getCellStyle()
    {
      short styleIndex=_record.getXFIndex();
      ExtendedFormatRecord xf = _book.getWorkbook().getExFormatAt(styleIndex);
      return new HSSFCellStyle(styleIndex, xf, _book);
    }
View Full Code Here

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

        InternalWorkbook iwb = _book.getWorkbook();
        short userXf = -1;
        int numfmt = iwb.getNumExFormats();
        for(short i = 0; i < numfmt; i++){
            ExtendedFormatRecord xf = iwb.getExFormatAt(i);
            if(xf.getXFType() == ExtendedFormatRecord.XF_CELL && xf.getParentIndex() == style.getIndex() ){
                userXf = i;
                break;
            }
        }
        short styleIndex;
        if (userXf == -1){
            ExtendedFormatRecord xfr = iwb.createCellXF();
            xfr.cloneStyleFrom(iwb.getExFormatAt(style.getIndex()));
            xfr.setIndentionOptions((short)0);
            xfr.setXFType(ExtendedFormatRecord.XF_CELL);
            xfr.setParentIndex(style.getIndex());
            styleIndex = (short)numfmt;
        } else {
            styleIndex = userXf;
        }
View Full Code Here

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

     {@link #isFormatted()} to check first.
     */
    public HSSFCellStyle getRowStyle() {
        if(!isFormatted()) { return null; }
        short styleIndex = row.getXFIndex();
        ExtendedFormatRecord xf = book.getWorkbook().getExFormatAt(styleIndex);
        return new HSSFCellStyle(styleIndex, xf, book);
    }
View Full Code Here

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

    if (record instanceof FormatRecord) {
      FormatRecord fr = (FormatRecord) record;
      _customFormatRecords.put(Integer.valueOf(fr.getIndexCode()), fr);
    }
    if (record instanceof ExtendedFormatRecord) {
      ExtendedFormatRecord xr = (ExtendedFormatRecord) record;
      _xfRecords.add(xr);
    }
  }
View Full Code Here

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

  /**
   * Returns the index of the format string, used by your cell, or -1 if none
   * found
   */
  public int getFormatIndex(CellValueRecordInterface cell) {
    ExtendedFormatRecord xfr = _xfRecords.get(cell.getXFIndex());
    if (xfr == null) {
      System.err.println("Cell " + cell.getRow() + "," + cell.getColumn()
          + " uses XF with index " + cell.getXFIndex() + ", but we don't have that");
      return -1;
    }
    return xfr.getFormatIndex();
  }
View Full Code Here

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

                    }
                    break;

                /* ExtendedFormatRecord */
                case ExtendedFormatRecord.sid:
                    ExtendedFormatRecord xFormatRecord = (ExtendedFormatRecord)record;
                    if (xFormatRecord.getXFType() == ExtendedFormatRecord.XF_CELL) {
                        short dataFormatIdx = xFormatRecord.getFormatIndex();
                        if (dataFormatIdx > 0) {
                            extendedFormats.put(currentXFormatIdx, dataFormatIdx);
                            if (log.isDebugEnabled()) {
                                debug(record, "[" + currentXFormatIdx
                                        + "]=FormatRecord[" + dataFormatIdx + "]");
View Full Code Here

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

        // Relying on the fact that by default the cellType is set to 0 which
        // is different to CELL_TYPE_BLANK hence the following method call correctly
        // creates a new blank cell.
        setCellType(CELL_TYPE_BLANK, false);
        ExtendedFormatRecord xf = book.getExFormatAt(0xf);

        setCellStyle(new HSSFCellStyle(( short ) 0xf, xf));
    }
View Full Code Here

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

                (( BoolErrRecord ) record).setRow(row);
                (( BoolErrRecord ) record).setXFIndex(( short ) 0);
                (( BoolErrRecord ) record).setValue(( byte ) 0);
                break;
        }
        ExtendedFormatRecord xf = book.getExFormatAt(0xf);

        setCellStyle(new HSSFCellStyle(( short ) 0xf, xf));
    }
View Full Code Here

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

            case CELL_TYPE_ERROR :
                errorValue = (( BoolErrRecord ) cval).getErrorValue();
                break;
        }
        ExtendedFormatRecord xf = book.getExFormatAt(cval.getXFIndex());

        setCellStyle(new HSSFCellStyle(( short ) cval.getXFIndex(), xf));
    }
View Full Code Here

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

     * @return the new Cell Style object
     */

    public HSSFCellStyle createCellStyle()
    {
        ExtendedFormatRecord xfr = workbook.createCellXF();
        short index = (short) (getNumCellStyles() - 1);
        HSSFCellStyle style = new HSSFCellStyle(index, xfr);

        return style;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.