/** * Same as {@link #toString()} * @return A1-style cell address string representation */ public String formatAsString() { return CellReference.convertNumToColString(this._col)+(this._row+1); } }
/** * Returns the three parts of the cell reference, the * Sheet name (or null if none supplied), the 1 based * row number, and the A based column letter. * This will not include any markers for absolute * references, so use {@link #formatAsString()} * to properly turn references into strings. * @return String array of { sheetName, rowString, colString } */ public String[] getCellRefParts() { return new String[] { _sheetName, Integer.toString(_rowIndex+1), convertNumToColString(_colIndex) }; }
protected String currentPosition() { return "Sheet (" + currentSheet.getSheetName() + ") cell (" + (currentRowNumber + 1) + CellReference.convertNumToColString(currentColumnNumber) + ")"; }
/** * * @return the last valid column index in a ALPHA-26 representation * (<code>IV</code> or <code>XFD</code>). */ public String getLastColumnName() { return CellReference.convertNumToColString(getLastColumnIndex()); }
/** * Appends cell reference with '$' markers for absolute values as required. * Sheet name is not included. */ /* package */ void appendCellReference(StringBuilder sb) { if (_colIndex != -1) { if(_isColAbs) { sb.append(ABSOLUTE_REFERENCE_MARKER); } sb.append( convertNumToColString(_colIndex)); } if (_rowIndex != -1) { if(_isRowAbs) { sb.append(ABSOLUTE_REFERENCE_MARKER); } sb.append(_rowIndex+1); } }
protected final String formatReferenceAsString() { StringBuilder builder = new StringBuilder(); // The bits in RefNPtg indicate offset, not relative/absolute values! if(isRowRelative()) { builder.append("RowOffset: ").append(getRow()).append(" "); } else { builder.append(getRow()+1); } if(isColRelative()) { builder.append(" ColOffset: ").append(getColumn()); } else { builder.append(CellReference.convertNumToColString(getColumn())); } return builder.toString(); } }
CellReference.convertNumToColString(_firstCell.getCol()) + ":" + CellReference.convertNumToColString(_lastCell.getCol());
/** * Set specified cell format * * @param excelFieldFormat the specified format * @param cell the cell to set up format */ private void setDataFormat( String excelFieldFormat, Cell cell ) { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "ExcelWriterStep.Log.SetDataFormat", excelFieldFormat, CellReference.convertNumToColString( cell.getColumnIndex() ), cell.getRowIndex() ) ); } DataFormat format = data.wb.createDataFormat(); short formatIndex = format.getFormat( excelFieldFormat ); CellStyle style = data.wb.createCellStyle(); style.cloneStyleFrom( cell.getCellStyle() ); style.setDataFormat( formatIndex ); cell.setCellStyle( style ); }
/** * Same as {@link #toString()} * @return A1-style cell address string representation */ public String formatAsString() { return CellReference.convertNumToColString(this._col)+(this._row+1); } }
public static String convertReferenceIntToString(int ref) { return CellReference.convertNumToColString(ref); }
/** * Returns the three parts of the cell reference, the * Sheet name (or null if none supplied), the 1 based * row number, and the A based column letter. * This will not include any markers for absolute * references, so use {@link #formatAsString()} * to properly turn references into strings. */ public String[] getCellRefParts() { return new String[] { _sheetName, Integer.toString(_rowIndex+1), convertNumToColString(_colIndex) }; }
/** * Appends cell reference with '$' markers for absolute values as required. * Sheet name is not included. */ /* package */ void appendCellReference(StringBuffer sb) { if(_isColAbs) { sb.append(ABSOLUTE_REFERENCE_MARKER); } sb.append( convertNumToColString(_colIndex)); if(_isRowAbs) { sb.append(ABSOLUTE_REFERENCE_MARKER); } sb.append(_rowIndex+1); }
protected String currentPosition() { return "Sheet (" + currentSheet.getSheetName() + ") cell (" + (currentRowNumber + 1) + CellReference.convertNumToColString(currentColumnNumber) + ")"; }
/** * * @return the last valid column index in a ALPHA-26 representation * (<code>IV</code> or <code>XFD</code>). */ public String getLastColumnName() { return CellReference.convertNumToColString(getLastColumnIndex()); }
/** * * @return the last valid column index in a ALPHA-26 representation * (<code>IV</code> or <code>XFD</code>). */ public String getLastColumnName() { return CellReference.convertNumToColString(getLastColumnIndex()); }
/** * * @return the last valid column index in a ALPHA-26 representation * (<code>IV</code> or <code>XFD</code>). */ public String getLastColumnName() { return CellReference.convertNumToColString(getLastColumnIndex()); }
@Override public String toString() { String letter = org.apache.poi.ss.util.CellReference.convertNumToColString(cell.getColumnIndex()); String text = getText(); return String.format("column %s: '%s'", letter, text); }
@Override public String getCellAddress() { return CellReference.convertNumToColString(cell.getColumnIndex()) + String.valueOf(cell.getRowIndex()+1); }
protected final String formatReferenceAsString() { StringBuilder builder = new StringBuilder(); // The bits in RefNPtg indicate offset, not relative/absolute values! if(isRowRelative()) { builder.append("RowOffset: ").append(getRow()).append(" "); } else { builder.append(getRow()+1); } if(isColRelative()) { builder.append(" ColOffset: ").append(getColumn()); } else { builder.append(CellReference.convertNumToColString(getColumn())); } return builder.toString(); } }
public Cell createCell(org.xlsx4j.sml.ObjectFactory factory, String stringContent, int colNum, long rowNum) { Cell cell = factory.createCell(); cell.setT(STCellType.STR); cell.setV(stringContent); cell.setR(CellReference.convertNumToColString(colNum - 1) + "" + rowNum); cell.setS(0L); return cell; }