Search in sources :

Example 26 with XSSFColor

use of org.apache.poi.xssf.usermodel.XSSFColor in project Gargoyle by callakrsos.

the class ExcelUtil method applyColor.

private static void applyColor(Workbook createNewWorkBookXlsx, ExcelColDVO dvo, Cell createCell) {
    Color backgroundColor = dvo.getBackgroundColor();
    if (backgroundColor != null) {
        XSSFCellStyle style = (XSSFCellStyle) createNewWorkBookXlsx.createCellStyle();
        style.setFillPattern(CellStyle.SOLID_FOREGROUND);
        style.setFillForegroundColor(new XSSFColor(backgroundColor));
        createCell.setCellStyle(style);
    }
}
Also used : XSSFColor(org.apache.poi.xssf.usermodel.XSSFColor) XSSFCellStyle(org.apache.poi.xssf.usermodel.XSSFCellStyle) Color(java.awt.Color) XSSFColor(org.apache.poi.xssf.usermodel.XSSFColor)

Aggregations

XSSFColor (org.apache.poi.xssf.usermodel.XSSFColor)26 XSSFCellStyle (org.apache.poi.xssf.usermodel.XSSFCellStyle)20 Cell (org.apache.poi.ss.usermodel.Cell)17 Row (org.apache.poi.ss.usermodel.Row)17 XSSFFont (org.apache.poi.xssf.usermodel.XSSFFont)17 CellRangeAddress (org.apache.poi.ss.util.CellRangeAddress)12 List (java.util.List)6 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)5 DateRangeScoreVO (com.netsteadfast.greenstep.vo.DateRangeScoreVO)4 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)4 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)4 Map (java.util.Map)4 BufferedImage (java.awt.image.BufferedImage)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 XSSFCell (org.apache.poi.xssf.usermodel.XSSFCell)3 XSSFWorkbook (org.apache.poi.xssf.usermodel.XSSFWorkbook)3 Test (org.junit.Test)3 CTColor (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)3 Color (java.awt.Color)2 ThemeElement (org.apache.poi.xssf.model.ThemesTable.ThemeElement)2