/** * Get the index of the number format (numFmt) record used by this cell format. * * @return the index of the number format */ public static long getNumberFormatIndex(Cell _cell) { Styles stylesPart = _cell.getWorksheetPart().getWorkbookPart().getStylesPart(); CTXf xf = stylesPart.getXfByIndex(_cell.getS()); if (xf == null) { throw new RuntimeException("xf unexpectedly null"); } log.debug("Using NumFmtId " + xf.getNumFmtId()); return xf.getNumFmtId(); //(short)_cellXf.getNumFmtId(); }
/** * Return the cell's style. * * @return the cell's style.</code> */ public static CTCellStyle getCellStyle(Cell _cell) { Styles stylesPart = _cell.getWorksheetPart().getWorkbookPart().getStylesPart(); CTXf xf = stylesPart.getXfByIndex(_cell.getS()); if (xf == null) { throw new RuntimeException("xf unexpectedly null"); } return stylesPart.getStyleByIndex(xf.getXfId()); }
/** * Get the index of the number format (numFmt) record used by this cell format. * * @return the index of the number format */ public static long getNumberFormatIndex(Cell _cell) { Styles stylesPart = _cell.getWorksheetPart().getWorkbookPart().getStylesPart(); CTXf xf = stylesPart.getXfByIndex(_cell.getS()); if (xf == null) { throw new RuntimeException("xf unexpectedly null"); } log.debug("Using NumFmtId " + xf.getNumFmtId()); return xf.getNumFmtId(); //(short)_cellXf.getNumFmtId(); }
/** * Return the cell's style. * * @return the cell's style.</code> */ public static CTCellStyle getCellStyle(Cell _cell) { Styles stylesPart = _cell.getWorksheetPart().getWorkbookPart().getStylesPart(); CTXf xf = stylesPart.getXfByIndex(_cell.getS()); if (xf == null) { throw new RuntimeException("xf unexpectedly null"); } return stylesPart.getStyleByIndex(xf.getXfId()); }