List of usage examples for org.apache.poi.ss.usermodel Font setFontHeightInPoints
void setFontHeightInPoints(short height);
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.ReviewerVendorPoXlsReportHelper.java
License:Apache License
private CellStyle getDateStyle(Workbook p_workbook) throws Exception { if (dateStyle == null) { Font defaultFont = p_workbook.createFont(); defaultFont.setFontName("Arial"); defaultFont.setFontHeightInPoints((short) 10); DataFormat format = p_workbook.createDataFormat(); CellStyle cs = p_workbook.createCellStyle(); cs.setFont(defaultFont);//www . j av a2 s .c o m cs.setDataFormat(format.getFormat(DEFAULT_DATE_FORMAT)); cs.setWrapText(false); dateStyle = cs; } return dateStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.ReviewerVendorPoXlsReportHelper.java
License:Apache License
private CellStyle getMoneyStyle(Workbook p_workbook) throws Exception { if (moneyStyle == null) { Font defaultFont = p_workbook.createFont(); defaultFont.setFontName("Arial"); defaultFont.setFontHeightInPoints((short) 10); DataFormat euroNumberFormat = p_workbook.createDataFormat(); CellStyle cs = p_workbook.createCellStyle(); cs.setFont(defaultFont);/*from w w w .j a va 2s. c om*/ cs.setWrapText(false); cs.setDataFormat(euroNumberFormat.getFormat(CurrencyThreadLocal.getMoneyFormatString())); moneyStyle = cs; } return moneyStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.ReviewerVendorPoXlsReportHelper.java
License:Apache License
private CellStyle getWrongJobStyle(Workbook p_workbook) throws Exception { if (wrongJobStyle == null) { Font wrongJobFont = p_workbook.createFont(); wrongJobFont.setBoldweight(Font.BOLDWEIGHT_BOLD); wrongJobFont.setColor(IndexedColors.GREY_50_PERCENT.getIndex()); wrongJobFont.setUnderline(Font.U_NONE); wrongJobFont.setFontName("Times"); wrongJobFont.setFontHeightInPoints((short) 11); CellStyle cs = p_workbook.createCellStyle(); cs.setFont(wrongJobFont);//w ww . j av a2 s .com wrongJobStyle = cs; } return wrongJobStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.ReviewerVendorPoXlsReportHelper.java
License:Apache License
private CellStyle getSubTotalStyle(Workbook p_workbook) throws Exception { if (subTotalStyle == null) { Font subTotalFont = p_workbook.createFont(); subTotalFont.setBoldweight(Font.BOLDWEIGHT_BOLD); subTotalFont.setColor(IndexedColors.BLACK.getIndex()); subTotalFont.setUnderline(Font.U_NONE); subTotalFont.setFontName("Arial"); subTotalFont.setFontHeightInPoints((short) 10); CellStyle cs = p_workbook.createCellStyle(); cs.setFont(subTotalFont);//from w w w . jav a 2 s . c om cs.setWrapText(true); cs.setBorderTop(CellStyle.BORDER_THIN); cs.setBorderBottom(CellStyle.BORDER_THIN); cs.setFillPattern(CellStyle.SOLID_FOREGROUND); cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); subTotalStyle = cs; } return subTotalStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.SlaXlsReportHelper.java
License:Apache License
private void addTitle(Workbook p_workbook) throws Exception { Sheet theSheet = data.generalSheet;//from ww w. j a v a 2 s . co m // title font is black bold on white Font titleFont = p_workbook.createFont(); titleFont.setUnderline(Font.U_NONE); titleFont.setFontName("Arial"); titleFont.setFontHeightInPoints((short) 14); titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD); titleFont.setColor(IndexedColors.BLACK.getIndex()); CellStyle titleStyle = p_workbook.createCellStyle(); titleStyle.setWrapText(false); titleStyle.setFont(titleFont); Cell titleCell = getCell(getRow(theSheet, 0), 0); titleCell.setCellValue(bundle.getString("translation_sla_performance")); titleCell.setCellStyle(titleStyle); theSheet.setColumnWidth(0, 20 * 256); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.SlaXlsReportHelper.java
License:Apache License
private CellStyle getHeaderStyle(Workbook p_workbook) throws Exception { if (headerStyle == null) { Font font = p_workbook.createFont(); font.setBoldweight(Font.BOLDWEIGHT_BOLD); font.setColor(IndexedColors.BLACK.getIndex()); font.setUnderline(Font.U_NONE); font.setFontName("Arial"); font.setFontHeightInPoints((short) 9); CellStyle cs = p_workbook.createCellStyle(); cs.setFont(font);//from www . j av a2 s. c om cs.setWrapText(true); cs.setFillPattern(CellStyle.SOLID_FOREGROUND); cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); cs.setBorderTop(CellStyle.BORDER_THIN); cs.setBorderRight(CellStyle.BORDER_THIN); cs.setBorderBottom(CellStyle.BORDER_THIN); cs.setBorderLeft(CellStyle.BORDER_THIN); headerStyle = cs; } return headerStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.SlaXlsReportHelper.java
License:Apache License
private CellStyle getContentRightStyle(Workbook p_workbook) throws Exception { if (contentRightStyle == null) { CellStyle style = p_workbook.createCellStyle(); style.setWrapText(true);/*from w w w . jav a 2 s .c om*/ style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); Font font = p_workbook.createFont(); font.setFontName("Arial"); font.setFontHeightInPoints((short) 10); style.setFont(font); contentRightStyle = style; } return contentRightStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.TranslationProgressReportHelper.java
License:Apache License
private void addTitle(Workbook p_workbook, Sheet p_sheet) throws Exception { // title font is black bold on white // String EMEA = CompanyWrapper.getCurrentCompanyName(); Font titleFont = p_workbook.createFont(); titleFont.setUnderline(Font.U_NONE); titleFont.setFontName("Times"); titleFont.setFontHeightInPoints((short) 14); titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD); titleFont.setColor(IndexedColors.BLACK.getIndex()); CellStyle titleStyle = p_workbook.createCellStyle(); titleStyle.setWrapText(false);/* w ww. java 2 s. c o m*/ titleStyle.setFont(titleFont); Row titleRow = getRow(p_sheet, 0); Cell cell_A_Title = getCell(titleRow, 0); cell_A_Title.setCellValue(bundle.getString("review_translation_progress_report")); cell_A_Title.setCellStyle(titleStyle); p_sheet.setColumnWidth(0, 22 * 256); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.TranslationProgressReportHelper.java
License:Apache License
private CellStyle getPercentStyle(Workbook p_workbook) throws Exception { if (percentStyle == null) { DataFormat format = p_workbook.createDataFormat(); CellStyle style = p_workbook.createCellStyle(); Font font = p_workbook.createFont(); font.setFontName("Arial"); font.setFontHeightInPoints((short) 10); style.setDataFormat(format.getFormat("0%")); style.setFont(font);/*from w w w .ja v a2s.c om*/ style.setWrapText(true); style.setAlignment(CellStyle.ALIGN_LEFT); percentStyle = style; } return percentStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.VendorPOXlsReport.java
License:Apache License
private void addTitle(Workbook p_workbook, Sheet p_sheet) throws Exception { // title font is black bold on white String EMEA = CompanyWrapper.getCurrentCompanyName(); Font titleFont = p_workbook.createFont(); titleFont.setUnderline(Font.U_NONE); titleFont.setFontName("Arial"); titleFont.setFontHeightInPoints((short) 14); titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD); titleFont.setColor(IndexedColors.BLACK.getIndex()); CellStyle titleStyle = p_workbook.createCellStyle(); titleStyle.setWrapText(false);/*from w ww .jav a2s . com*/ titleStyle.setFont(titleFont); Row titleRow = getRow(p_sheet, 0); Cell cell_A_Title = getCell(titleRow, 0); cell_A_Title.setCellValue(EMEA + " " + bundle.getString("lb_po")); cell_A_Title.setCellStyle(titleStyle); p_sheet.setColumnWidth(0, 20 * 256); }