//Iterate through cells while (cells.hasNext()) { cell = (HSSFCell) cells.next(); HSSFCellStyle style = (HSSFCellStyle) cell.getCellStyle(); HSSFFont font = style.getFont(workbook); boolean isBold = font.getBold(); System.out.println("Cell value : " + cell + ". Is bold? - " + isBold); }
byte underline = cell.getCellStyle().getFont(workbook).getUnderline(); if (underline == 1) { primaryKeyList.add(columnName);
public void colorStyles(CellStyle style, Formatter out) { HSSFCellStyle cs = (HSSFCellStyle) style; out.format(" /* fill pattern = %d */%n", cs.getFillPattern()); styleColor(out, "background-color", cs.getFillForegroundColor()); styleColor(out, "color", colors.getColor(cs.getFont(wb).getColor())); }
public void colorStyles(CellStyle style, Formatter out) { HSSFCellStyle cs = (HSSFCellStyle) style; out.format(" /* fill pattern = %d */%n", cs.getFillPattern()); styleColor(out, "background-color", cs.getFillForegroundColor()); styleColor(out, "color", colors.getColor(cs.getFont(wb).getColor())); }
public void colorStyles(CellStyle style, Formatter out) { HSSFCellStyle cs = (HSSFCellStyle) style; out.format(" /* fill pattern = %d */%n", cs.getFillPattern()); styleColor(out, "background-color", cs.getFillForegroundColor()); styleColor(out, "color", colors.getColor(cs.getFont(wb).getColor())); }
protected HSSFCellStyle copyCellStyle(HSSFCellStyle templateStyle) { HSSFCellStyle style = styleCache.getCellStyleByTemplate(templateStyle); if (style == null) { HSSFCellStyle newStyle = resultWorkbook.createCellStyle(); XslStyleHelper.cloneStyleRelations(templateStyle, newStyle); HSSFFont templateFont = templateStyle.getFont(templateWorkbook); HSSFFont font = fontCache.getFontByTemplate(templateFont); if (font != null) newStyle.setFont(font); else { XslStyleHelper.cloneFont(templateStyle, newStyle); fontCache.addCachedFont(templateFont, newStyle.getFont(resultWorkbook)); } styleCache.addCachedStyle(templateStyle, newStyle); style = newStyle; } return style; }
@Override public void colorStyles(CellStyle style, Formatter out) { HSSFCellStyle cs = (HSSFCellStyle) style; if (cs.getFillPattern() != FillPatternType.NO_FILL) { out.format(" /* fill pattern = %s */%n", cs.getFillPattern()); } styleColor(out, "background-color", cs.getFillForegroundColor()); styleColor(out, "color", colors.getColor(cs.getFont(wb).getColor())); }
protected HSSFCellStyle copyCellStyle(HSSFCellStyle templateStyle) { HSSFCellStyle style = styleCache.getCellStyleByTemplate(templateStyle); if (style == null) { HSSFCellStyle newStyle = resultWorkbook.createCellStyle(); XslStyleHelper.cloneStyleRelations(templateStyle, newStyle); HSSFFont templateFont = templateStyle.getFont(templateWorkbook); HSSFFont font = fontCache.getFontByTemplate(templateFont); if (font != null) newStyle.setFont(font); else { XslStyleHelper.cloneFont(templateStyle, newStyle); fontCache.addCachedFont(templateFont, newStyle.getFont(resultWorkbook)); } styleCache.addCachedStyle(templateStyle, newStyle); style = newStyle; } return style; }
cellStyle.getLeftBorderColor() ); HSSFFont font = cellStyle.getFont( workbook ); buildStyle_font( workbook, style, font );
@Override public void colorStyles(CellStyle style, Formatter out) { HSSFCellStyle cs = (HSSFCellStyle) style; out.format(" /* fill pattern = %d */%n", cs.getFillPattern().getCode()); styleColor(out, "background-color", cs.getFillForegroundColor()); styleColor(out, "color", cs.getFont(wb).getColor()); styleColor(out, "border-left-color", cs.getLeftBorderColor()); styleColor(out, "border-right-color", cs.getRightBorderColor()); styleColor(out, "border-top-color", cs.getTopBorderColor()); styleColor(out, "border-bottom-color", cs.getBottomBorderColor()); }
cellStyle.getLeftBorderColor() ); HSSFFont font = cellStyle.getFont( workbook ); buildStyle_font( workbook, style, font );
cellStyle.getBorderLeft(), cellStyle.getLeftBorderColor() ); HSSFFont font = cellStyle.getFont( workbook ); processCellStyleFont( workbook, blockTarget, font );
styleNew.setFillForegroundColor(styleOld.getFillForegroundColor()); styleNew.setFillPattern(styleOld.getFillPattern()); styleNew.setFont(this.transform(workbookNew,styleOld.getFont(workbookOld))); styleNew.setHidden(styleOld.getHidden()); styleNew.setIndention(styleOld.getIndention());
cellStyle.getBorderLeft(), cellStyle.getLeftBorderColor() ); HSSFFont font = cellStyle.getFont( workbook ); processCellStyleFont( workbook, blockTarget, font );
newStyle.setWrapText(cellStyle.getWrapText()); HSSFFont cellFont = cellStyle.getFont(templateWorkbook); HSSFFont newFont = fontCache.getFontByTemplate(cellFont);
newStyle.setWrapText(cellStyle.getWrapText()); HSSFFont cellFont = cellStyle.getFont(templateWorkbook); HSSFFont newFont = fontCache.getFontByTemplate(cellFont);
style.setValign(Alignment.middle); HSSFFont font=cellStyle.getFont(book); if(font.getBold()){ style.setBold(true);