HSSFCellStyle style=workbook.createCellStyle(); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
headerSyle.setBorderBottom(CellStyle.BORDER_THIN); headerSyle.setBottomBorderColor(IndexedColors.BLACK.getIndex()); headerSyle.setFont(boldFont);
HSSFCellStyle style= wb.createCellStyle(); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderTop(HSSFCellStyle.BORDER_THIN);
private static HSSFCellStyle setAllBorders(short borderWeight, HSSFCellStyle existingStyle) { existingStyle.setBorderBottom(borderWeight); existingStyle.setBorderTop(borderWeight); existingStyle.setBorderLeft(borderWeight); existingStyle.setBorderRight(borderWeight); return existingStyle; }
HSSFCellStyle my_style = my_workbook.createCellStyle(); /* Draw a thin left border */ my_style.setBorderLeft(HSSFCellStyle.BORDER_THIN);/* Add medium right border */ my_style.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);/* Add dashed top border */ my_style.setBorderTop(HSSFCellStyle.BORDER_DASHED); /* Add dotted bottom border */ my_style.setBorderBottom(HSSFCellStyle.BORDER_DOTTED);
HSSFCellStyle style=wb.createCellStyle(); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
public static HSSFCellStyle rowStyle2(final HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_MEDIUM); style.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM); style.setBorderRight(HSSFCellStyle.BORDER_MEDIUM); style.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM); return style; } }
private void whiteDataStyle(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFont(fontNormal); styles.put(I_WhiteDataStyle, style); }
private void whiteDataStyleRed(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFont(fontRed); styles.put(I_WhiteDataStyleRed, style); }
private void headerStyle2Red(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_MEDIUM); style.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM); style.setBorderRight(HSSFCellStyle.BORDER_MEDIUM); style.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFont(fontSmallRed); styles.put(I_HeaderStyle2Red, style); }
private void headerStyle2(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_MEDIUM); style.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM); style.setBorderRight(HSSFCellStyle.BORDER_MEDIUM); style.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFont(fontSmall); styles.put(I_HeaderStyle2, style); }
private void initWhiteDataStyleSmall(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFont(fontSmall); styles.put(I_WhiteDataStyleSmall, style); }
/** * Obtain the style used to render a header or footer. * @return The style used to render a header or footer. */ private HSSFCellStyle getHeaderFooterStyle() { HSSFCellStyle style = this.wb.createCellStyle(); HSSFFont bold = this.wb.createFont(); bold.setBold(true); style.setBorderBottom(BorderStyle.THIN); style.setBottomBorderColor(IndexedColors.BLACK.getIndex()); style.setFont(bold); return style; }
HSSFColor borderColor=buildHSSFColor(wb,bottomBorder.getColor()); style.setBottomBorderColor(borderColor.getIndex()); style.setBorderBottom(borderStyle);
private HSSFCellStyle getDefaultExcelCellStyle(PoiWorkBook daouWorkBook) { HSSFWorkbook wb = daouWorkBook.getWorkBook(); HSSFCellStyle cs = wb.createCellStyle(); cs.setAlignment(HorizontalAlignment.CENTER); cs.setVerticalAlignment(VerticalAlignment.CENTER); cs.setBorderTop(BorderStyle.THIN); cs.setBorderRight(BorderStyle.THIN); cs.setBorderLeft(BorderStyle.THIN); cs.setBorderBottom(BorderStyle.THIN); return cs; }
private void whiteDataStyleEnd(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFont(fontNormal); style.setBorderRight(HSSFCellStyle.BORDER_MEDIUM); styles.put(I_WhiteDataStyleEnd, style); }
private void greyDataStyleRed(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFont(fontRed); styles.put(I_GreyDataStyleRed, style); }
private void createDefaultHeaderCellStyle() { headerCellStyle = workbook.createCellStyle(); HSSFFont font = workbook.createFont(); font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); font.setColor(HSSFColor.WHITE.index); headerCellStyle.setFont(font); headerCellStyle .setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index); headerCellStyle.setFillPattern(HSSFCellStyle.FINE_DOTS); headerCellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); headerCellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); }
private void greyDataStyle(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); style.setFont(fontNormal); styles.put(I_GreyDataStyle, style); }
private void greyDataStyleSmall(HSSFSheet sheet) { HSSFCellStyle style = sheet.getWorkbook().createCellStyle(); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); style.setWrapText(true); style.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index); style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); style.setFont(fontSmall); styles.put(I_GreyDataStyleSmall, style); }