public static void initStyles(HSSFWorkbook wb) { wb1 = wb; setHeadingStyle(createCustomStyle(createCustomFont(HSSFColor.LEMON_CHIFFON.index, HSSFFont.U_NONE), HSSFCellStyle.ALIGN_CENTER)); getHeadingStyle().setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); getHeadingStyle().setFillForegroundColor(new HSSFColor.BLUE_GREY().getIndex()); setHeadingStyle(setAllBorders(HSSFCellStyle.BORDER_DOUBLE, getHeadingStyle())); subHeading1Style = createCustomStyle(createCustomFont(HSSFColor.LIGHT_BLUE.index, HSSFFont.U_NONE)); subHeading1Style = setAllBorders(HSSFCellStyle.BORDER_THIN, subHeading1Style); setSubHeading2Style(createCustomStyle(createCustomFont(HSSFColor.BROWN.index, HSSFFont.U_NONE), HSSFCellStyle.ALIGN_CENTER)); setSubHeading2Style(setAllBorders(HSSFCellStyle.BORDER_MEDIUM, getSubHeading2Style())); setSubHeading2StyleThinBorder(createCustomStyle(createCustomFont(HSSFColor.BROWN.index, HSSFFont.U_NONE), HSSFCellStyle.ALIGN_LEFT)); setSubHeading2StyleThinBorder(setAllBorders(HSSFCellStyle.BORDER_THIN, getSubHeading2StyleThinBorder())); setThinBorderStyle(wb.createCellStyle()); setThinBorderStyle(setAllBorders(HSSFCellStyle.BORDER_THIN, getThinBorderStyle())); setStyleBorderThinCenter(wb.createCellStyle()); setStyleBorderThinCenter(setAllBorders(HSSFCellStyle.BORDER_THIN, getStyleBorderThinCenter())); getStyleBorderThinCenter().setAlignment(HSSFCellStyle.ALIGN_CENTER); setStyleBorderThinLeftTop(wb.createCellStyle()); setStyleBorderThinLeftTop(setAllBorders(HSSFCellStyle.BORDER_THIN, getStyleBorderThinLeftTop())); getStyleBorderThinLeftTop().setAlignment(HSSFCellStyle.ALIGN_LEFT); getStyleBorderThinLeftTop().setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP); setHyperLinkStyle(wb.createCellStyle()); setHyperLinkStyle(setAllBorders(HSSFCellStyle.BORDER_THIN, getHyperLinkStyle())); HSSFFont hyperLinkFont = createCustomFont(HSSFColor.BLUE.index, HSSFFont.U_SINGLE); hyperLinkFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); getHyperLinkStyle().setFont(hyperLinkFont); }