List of usage examples for org.apache.poi.ss.usermodel CellStyle setWrapText
void setWrapText(boolean wrapped);
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.OnlineJobsReportForIPTranslatorGenerator.java
License:Apache License
private CellStyle getFailedTimeStyle(Workbook p_workbook) throws Exception { if (failedTimeStyle == null) { DataFormat dataFormat = p_workbook.createDataFormat(); CellStyle cs = p_workbook.createCellStyle(); cs.setWrapText(false); cs.setDataFormat(dataFormat.getFormat("h:mm:ss AM/PM")); cs.setFillPattern(CellStyle.SOLID_FOREGROUND); cs.setFillForegroundColor(IndexedColors.RED.getIndex()); failedTimeStyle = cs;/*from w ww .j a v a 2 s . co m*/ } return failedTimeStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.OnlineJobsReportForIPTranslatorGenerator.java
License:Apache License
private CellStyle getFailedMoneyStyle(Workbook p_workbook) throws Exception { if (failedMoneyStyle == null) { String euroJavaNumberFormat = getCurrencyNumberFormat(); DataFormat euroNumberFormat = p_workbook.createDataFormat(); CellStyle cs = p_workbook.createCellStyle(); cs.setWrapText(false); cs.setDataFormat(euroNumberFormat.getFormat(euroJavaNumberFormat)); cs.setFillPattern(CellStyle.SOLID_FOREGROUND); cs.setFillForegroundColor(IndexedColors.RED.getIndex()); failedMoneyStyle = cs;/*from w w w. j av a 2 s .c om*/ } return failedMoneyStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.OnlineJobsReportForIPTranslatorGenerator.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 ww w . j a v a2 s .co m*/ 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.generator.OnlineJobsReportForIPTranslatorGenerator.java
License:Apache License
private CellStyle getTotalMoneyStyle(Workbook p_workbook) throws Exception { if (totalMoneyStyle == null) { String euroJavaNumberFormat = getCurrencyNumberFormat(); DataFormat euroNumberFormat = p_workbook.createDataFormat(); CellStyle cs = p_workbook.createCellStyle(); cs.setDataFormat(euroNumberFormat.getFormat(euroJavaNumberFormat)); cs.setWrapText(false); cs.setFillPattern(CellStyle.SOLID_FOREGROUND); cs.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); cs.setBorderTop(CellStyle.BORDER_THIN); cs.setBorderBottom(CellStyle.BORDER_THIN); totalMoneyStyle = cs;/*w w w . jav a 2 s . c o m*/ } return totalMoneyStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.OnlineJobsReportGenerator.java
License:Apache License
private void addTitle(Workbook p_workbook, Sheet p_sheet) throws Exception { 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); CellStyle titleStyle = p_workbook.createCellStyle(); titleStyle.setWrapText(false); titleStyle.setFont(titleFont);//w w w . ja v a2 s .c o m Row firRow = getRow(p_sheet, 0); Cell titleCell = getCell(firRow, 0); titleCell.setCellValue(EMEA + " " + m_bundle.getString("lb_online")); titleCell.setCellStyle(titleStyle); p_sheet.setColumnWidth(0, 20 * 256); }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.ReviewersCommentsSimpleReportGenerator.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("Times"); font.setFontHeightInPoints((short) 11); CellStyle cs = p_workbook.createCellStyle(); cs.setFont(font);/*w w w . j a v a2 s . c om*/ cs.setWrapText(true); cs.setFillPattern(CellStyle.SOLID_FOREGROUND); cs.setFillForegroundColor(IndexedColors.GREY_40_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.generator.ReviewersCommentsSimpleReportGenerator.java
License:Apache License
private CellStyle getContentStyle(Workbook p_workbook) throws Exception { if (contentStyle == null) { CellStyle style = p_workbook.createCellStyle(); style.setWrapText(true); style.setAlignment(CellStyle.ALIGN_LEFT); style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); style.setBorderTop(CellStyle.BORDER_THIN); style.setBorderRight(CellStyle.BORDER_THIN); style.setBorderBottom(CellStyle.BORDER_THIN); style.setBorderLeft(CellStyle.BORDER_THIN); Font font = p_workbook.createFont(); font.setFontName("Arial"); font.setFontHeightInPoints((short) 10); style.setFont(font);// w w w. j av a2 s .c o m contentStyle = style; } return contentStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.ReviewersCommentsSimpleReportGenerator.java
License:Apache License
private CellStyle getIceContentStyle(Workbook p_workbook) throws Exception { if (iceContentStyle == null) { CellStyle style = p_workbook.createCellStyle(); style.setWrapText(true); style.setAlignment(CellStyle.ALIGN_LEFT); style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); style.setFillPattern(CellStyle.SOLID_FOREGROUND); style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); style.setBorderTop(CellStyle.BORDER_THIN); style.setBorderRight(CellStyle.BORDER_THIN); style.setBorderBottom(CellStyle.BORDER_THIN); style.setBorderLeft(CellStyle.BORDER_THIN); Font font = p_workbook.createFont(); font.setFontName("Arial"); font.setFontHeightInPoints((short) 10); style.setFont(font);/*from ww w .j a v a 2 s.co m*/ iceContentStyle = style; } return iceContentStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.ReviewersCommentsSimpleReportGenerator.java
License:Apache License
private CellStyle getExactContentStyle(Workbook p_workbook) throws Exception { if (exactContentStyle == null) { CellStyle style = p_workbook.createCellStyle(); style.setWrapText(true); style.setAlignment(CellStyle.ALIGN_LEFT); style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); style.setFillPattern(CellStyle.SOLID_FOREGROUND); style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); style.setBorderTop(CellStyle.BORDER_THIN); style.setBorderRight(CellStyle.BORDER_THIN); style.setBorderBottom(CellStyle.BORDER_THIN); style.setBorderLeft(CellStyle.BORDER_THIN); Font font = p_workbook.createFont(); font.setFontName("Arial"); font.setFontHeightInPoints((short) 10); style.setFont(font);//from www . ja v a 2s. c om exactContentStyle = style; } return exactContentStyle; }
From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.ReviewersCommentsSimpleReportGenerator.java
License:Apache License
private CellStyle getRtlContentStyle(Workbook p_workbook) throws Exception { if (rtlContentStyle == null) { Font font = p_workbook.createFont(); font.setFontName("Arial"); font.setFontHeightInPoints((short) 10); CellStyle style = p_workbook.createCellStyle(); style.setFont(font);/* w w w .j a va 2 s . co m*/ style.setWrapText(true); style.setAlignment(CellStyle.ALIGN_RIGHT); style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); style.setBorderTop(CellStyle.BORDER_THIN); style.setBorderRight(CellStyle.BORDER_THIN); style.setBorderBottom(CellStyle.BORDER_THIN); style.setBorderLeft(CellStyle.BORDER_THIN); rtlContentStyle = style; } return rtlContentStyle; }