Search in sources :

Example 16 with XSSFFont

use of org.apache.poi.xssf.usermodel.XSSFFont in project bamboobsc by billchen198318.

the class PdcaReportExcelCommand method createPdcaItem.

private int createPdcaItem(XSSFWorkbook wb, XSSFSheet sh, int row, XSSFCellStyle cellNormalStyle, List<PdcaItemVO> items, PdcaAuditVO audit) throws Exception {
    XSSFColor fnColor = new XSSFColor(SimpleUtils.getColorRGB4POIColor("#000000"));
    XSSFColor bgLabelColor = new XSSFColor(SimpleUtils.getColorRGB4POIColor("#F2F2F2"));
    XSSFCellStyle cellLabelStyle = wb.createCellStyle();
    cellLabelStyle.setFillForegroundColor(bgLabelColor);
    cellLabelStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    XSSFFont cellLabelFont = wb.createFont();
    cellLabelFont.setBold(true);
    cellLabelFont.setColor(fnColor);
    cellLabelStyle.setFont(cellLabelFont);
    cellLabelStyle.setBorderBottom(BorderStyle.THIN);
    cellLabelStyle.setBorderTop(BorderStyle.THIN);
    cellLabelStyle.setBorderRight(BorderStyle.THIN);
    cellLabelStyle.setBorderLeft(BorderStyle.THIN);
    cellLabelStyle.setVerticalAlignment(VerticalAlignment.CENTER);
    cellLabelStyle.setAlignment(HorizontalAlignment.CENTER);
    cellLabelStyle.setWrapText(true);
    Map<String, String> pdcaTypeMap = PdcaType.getDataMap(false);
    for (PdcaItemVO item : items) {
        Row labelRow = sh.createRow(row);
        Cell labelCell_6_1 = labelRow.createCell(0);
        labelCell_6_1.setCellValue(pdcaTypeMap.get(item.getType()));
        labelCell_6_1.setCellStyle(cellLabelStyle);
        Cell labelCell_6_2 = labelRow.createCell(1);
        labelCell_6_2.setCellValue(item.getTitle() + (!StringUtils.isBlank(item.getDescription()) ? "\n\n" + item.getDescription() : ""));
        labelCell_6_2.setCellStyle(cellNormalStyle);
        Cell labelCell_6_3 = labelRow.createCell(2);
        labelCell_6_3.setCellValue(item.getEmployeeAppendNames());
        labelCell_6_3.setCellStyle(cellNormalStyle);
        Cell labelCell_6_4 = labelRow.createCell(3);
        labelCell_6_4.setCellValue(item.getStartDateDisplayValue() + " ~ " + item.getEndDateDisplayValue());
        labelCell_6_4.setCellStyle(cellNormalStyle);
        Cell labelCell_6_5 = labelRow.createCell(4);
        labelCell_6_5.setCellValue((audit != null ? audit.getEmpId() : " "));
        labelCell_6_5.setCellStyle(cellNormalStyle);
        Cell labelCell_6_6 = labelRow.createCell(5);
        labelCell_6_6.setCellValue((audit != null ? audit.getConfirmDateDisplayValue() : " "));
        labelCell_6_6.setCellStyle(cellNormalStyle);
        row++;
    }
    return row;
}
Also used : XSSFColor(org.apache.poi.xssf.usermodel.XSSFColor) XSSFCellStyle(org.apache.poi.xssf.usermodel.XSSFCellStyle) XSSFFont(org.apache.poi.xssf.usermodel.XSSFFont) Row(org.apache.poi.ss.usermodel.Row) PdcaItemVO(com.netsteadfast.greenstep.vo.PdcaItemVO) Cell(org.apache.poi.ss.usermodel.Cell)

Example 17 with XSSFFont

use of org.apache.poi.xssf.usermodel.XSSFFont in project bamboobsc by billchen198318.

the class KpiReportExcelCommand method createDateRange.

private int createDateRange(XSSFWorkbook wb, XSSFSheet sh, int row, VisionVO vision, Context context) throws Exception {
    String frequency = (String) context.get("frequency");
    String startYearDate = StringUtils.defaultString((String) context.get("startYearDate")).trim();
    String endYearDate = StringUtils.defaultString((String) context.get("endYearDate")).trim();
    String startDate = StringUtils.defaultString((String) context.get("startDate")).trim();
    String endDate = StringUtils.defaultString((String) context.get("endDate")).trim();
    String date1 = startDate;
    String date2 = endDate;
    if (BscMeasureDataFrequency.FREQUENCY_QUARTER.equals(frequency) || BscMeasureDataFrequency.FREQUENCY_HALF_OF_YEAR.equals(frequency) || BscMeasureDataFrequency.FREQUENCY_YEAR.equals(frequency)) {
        date1 = startYearDate + "/01/01";
        date2 = endYearDate + "/12/" + SimpleUtils.getMaxDayOfMonth(Integer.parseInt(endYearDate), 12);
    }
    Map<String, Object> headContentMap = new HashMap<String, Object>();
    this.fillHeadContent(context, headContentMap);
    XSSFCellStyle cellStyleLabel = wb.createCellStyle();
    cellStyleLabel.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(BscReportPropertyUtils.getBackgroundColor())));
    cellStyleLabel.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    XSSFFont cellFontLabel = wb.createFont();
    cellFontLabel.setBold(false);
    cellFontLabel.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(BscReportPropertyUtils.getFontColor())));
    cellStyleLabel.setFont(cellFontLabel);
    cellStyleLabel.setWrapText(true);
    //cellStyleLabel.setVerticalAlignment(VerticalAlignment.CENTER);
    cellStyleLabel.setBorderBottom(BorderStyle.THIN);
    cellStyleLabel.setBorderTop(BorderStyle.THIN);
    cellStyleLabel.setBorderRight(BorderStyle.THIN);
    cellStyleLabel.setBorderLeft(BorderStyle.THIN);
    int cols = 4 + vision.getPerspectives().get(0).getObjectives().get(0).getKpis().get(0).getDateRangeScores().size();
    int cell = 0;
    for (int i = 0; i < cols; i++) {
        String content = "Frequency: " + BscMeasureDataFrequency.getFrequencyMap(false).get(frequency) + " Date range: " + date1 + " ~ " + date2 + "\n" + StringUtils.defaultString((String) headContentMap.get("headContent"));
        Row headRow = sh.createRow(row);
        headRow.setHeight((short) 700);
        Cell headCell1 = headRow.createCell(cell);
        headCell1.setCellValue(content);
        headCell1.setCellStyle(cellStyleLabel);
    }
    sh.addMergedRegion(new CellRangeAddress(row, row, 0, cols - 1));
    row++;
    int kpiCols = 4;
    int kpiRows = 2;
    for (PerspectiveVO perspective : vision.getPerspectives()) {
        for (ObjectiveVO objective : perspective.getObjectives()) {
            for (KpiVO kpi : objective.getKpis()) {
                cell = 0;
                for (int r = 0; r < kpiRows; r++) {
                    Row contentRow = sh.createRow(row++);
                    contentRow.setHeight((short) 400);
                    for (int c = 0; c < kpiCols; c++) {
                        XSSFCellStyle cellStyle = wb.createCellStyle();
                        cellStyle.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(kpi.getBgColor())));
                        cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
                        XSSFFont cellFont = wb.createFont();
                        cellFont.setBold(false);
                        cellFont.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(kpi.getFontColor())));
                        cellStyle.setFont(cellFont);
                        cellStyle.setWrapText(true);
                        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
                        cellStyle.setBorderBottom(BorderStyle.THIN);
                        cellStyle.setBorderTop(BorderStyle.THIN);
                        cellStyle.setBorderRight(BorderStyle.THIN);
                        cellStyle.setBorderLeft(BorderStyle.THIN);
                        Cell contentCell1 = contentRow.createCell(c);
                        contentCell1.setCellValue(kpi.getName());
                        contentCell1.setCellStyle(cellStyle);
                    }
                    cell = 4;
                    if (r == 0) {
                        for (int d = 0; d < kpi.getDateRangeScores().size(); d++) {
                            DateRangeScoreVO dateRangeScore = kpi.getDateRangeScores().get(d);
                            XSSFCellStyle cellStyle = wb.createCellStyle();
                            cellStyle.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(dateRangeScore.getBgColor())));
                            cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
                            XSSFFont cellFont = wb.createFont();
                            cellFont.setBold(false);
                            cellFont.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(dateRangeScore.getFontColor())));
                            cellStyle.setFont(cellFont);
                            cellStyle.setWrapText(true);
                            cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
                            cellStyle.setBorderBottom(BorderStyle.THIN);
                            cellStyle.setBorderTop(BorderStyle.THIN);
                            cellStyle.setBorderRight(BorderStyle.THIN);
                            cellStyle.setBorderLeft(BorderStyle.THIN);
                            Cell contentCell1 = contentRow.createCell(cell++);
                            contentCell1.setCellValue(dateRangeScore.getDate());
                            contentCell1.setCellStyle(cellStyle);
                        }
                    }
                    if (r == 1) {
                        for (int d = 0; d < kpi.getDateRangeScores().size(); d++) {
                            DateRangeScoreVO dateRangeScore = kpi.getDateRangeScores().get(d);
                            XSSFCellStyle cellStyle = wb.createCellStyle();
                            cellStyle.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(dateRangeScore.getBgColor())));
                            cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
                            XSSFFont cellFont = wb.createFont();
                            cellFont.setBold(false);
                            cellFont.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(dateRangeScore.getFontColor())));
                            cellStyle.setFont(cellFont);
                            cellStyle.setWrapText(true);
                            cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
                            cellStyle.setBorderBottom(BorderStyle.THIN);
                            cellStyle.setBorderTop(BorderStyle.THIN);
                            cellStyle.setBorderRight(BorderStyle.THIN);
                            cellStyle.setBorderLeft(BorderStyle.THIN);
                            Cell contentCell1 = contentRow.createCell(cell++);
                            contentCell1.setCellValue("      " + BscReportSupportUtils.parse2(dateRangeScore.getScore()));
                            contentCell1.setCellStyle(cellStyle);
                            byte[] imgBytes = BscReportSupportUtils.getByteIcon(kpi, dateRangeScore.getScore());
                            if (null != imgBytes) {
                                SimpleUtils.setCellPicture(wb, sh, imgBytes, contentCell1.getRowIndex(), contentCell1.getColumnIndex());
                            }
                        }
                    }
                }
                sh.addMergedRegion(new CellRangeAddress(row - 2, row - 1, 0, kpiCols - 1));
            }
        }
    }
    return row++;
}
Also used : HashMap(java.util.HashMap) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) DateRangeScoreVO(com.netsteadfast.greenstep.vo.DateRangeScoreVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) XSSFColor(org.apache.poi.xssf.usermodel.XSSFColor) XSSFCellStyle(org.apache.poi.xssf.usermodel.XSSFCellStyle) XSSFFont(org.apache.poi.xssf.usermodel.XSSFFont) Row(org.apache.poi.ss.usermodel.Row) CellRangeAddress(org.apache.poi.ss.util.CellRangeAddress) Cell(org.apache.poi.ss.usermodel.Cell)

Example 18 with XSSFFont

use of org.apache.poi.xssf.usermodel.XSSFFont in project bamboobsc by billchen198318.

the class KpiReportExcelCommand method createMainBody.

private int createMainBody(XSSFWorkbook wb, XSSFSheet sh, int row, VisionVO vision) throws Exception {
    Map<String, String> managementMap = BscKpiCode.getManagementMap(false);
    //Map<String, String> calculationMap = BscKpiCode.getCalculationMap(false);
    int itemCols = 4;
    int mrRow = row;
    for (int px = 0; px < vision.getPerspectives().size(); px++) {
        PerspectiveVO perspective = vision.getPerspectives().get(px);
        for (int ox = 0; ox < perspective.getObjectives().size(); ox++) {
            ObjectiveVO objective = perspective.getObjectives().get(ox);
            for (int kx = 0; kx < objective.getKpis().size(); kx++) {
                KpiVO kpi = objective.getKpis().get(kx);
                Row contentRow = sh.createRow(row++);
                contentRow.setHeight((short) 4000);
                int cell = 0;
                for (int i = 0; i < itemCols; i++) {
                    String content = this.getItemsContent(perspective.getName(), perspective.getScore(), perspective.getWeight(), perspective.getTarget(), perspective.getMin());
                    XSSFCellStyle cellStyle = wb.createCellStyle();
                    cellStyle.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(perspective.getBgColor())));
                    cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
                    XSSFFont cellFont = wb.createFont();
                    cellFont.setBold(false);
                    cellFont.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(perspective.getFontColor())));
                    cellStyle.setFont(cellFont);
                    cellStyle.setWrapText(true);
                    cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
                    cellStyle.setBorderBottom(BorderStyle.THIN);
                    cellStyle.setBorderTop(BorderStyle.THIN);
                    cellStyle.setBorderRight(BorderStyle.THIN);
                    cellStyle.setBorderLeft(BorderStyle.THIN);
                    Cell contentCell1 = contentRow.createCell(cell++);
                    contentCell1.setCellValue("\n" + content);
                    contentCell1.setCellStyle(cellStyle);
                    if (i == 0 && ox == 0) {
                        byte[] imgBytes = BscReportSupportUtils.getByteIconBase("PERSPECTIVES", perspective.getTarget(), perspective.getMin(), perspective.getScore(), "", "", 0);
                        if (null != imgBytes) {
                            SimpleUtils.setCellPicture(wb, sh, imgBytes, contentCell1.getRowIndex(), contentCell1.getColumnIndex());
                        }
                    }
                }
                for (int i = 0; i < itemCols; i++) {
                    String content = this.getItemsContent(objective.getName(), objective.getScore(), objective.getWeight(), objective.getTarget(), objective.getMin());
                    XSSFCellStyle cellStyle = wb.createCellStyle();
                    cellStyle.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(objective.getBgColor())));
                    cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
                    XSSFFont cellFont = wb.createFont();
                    cellFont.setBold(false);
                    cellFont.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(objective.getFontColor())));
                    cellStyle.setFont(cellFont);
                    cellStyle.setWrapText(true);
                    cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
                    cellStyle.setBorderBottom(BorderStyle.THIN);
                    cellStyle.setBorderTop(BorderStyle.THIN);
                    cellStyle.setBorderRight(BorderStyle.THIN);
                    cellStyle.setBorderLeft(BorderStyle.THIN);
                    Cell contentCell1 = contentRow.createCell(cell++);
                    contentCell1.setCellValue("\n" + content);
                    contentCell1.setCellStyle(cellStyle);
                    if (i == 0 && kx == 0) {
                        byte[] imgBytes = BscReportSupportUtils.getByteIconBase("OBJECTIVES", objective.getTarget(), objective.getMin(), objective.getScore(), "", "", 0);
                        if (null != imgBytes) {
                            SimpleUtils.setCellPicture(wb, sh, imgBytes, contentCell1.getRowIndex(), contentCell1.getColumnIndex());
                        }
                    }
                }
                for (int i = 0; i < itemCols; i++) {
                    //String content = this.getKpisContent(kpi, managementMap, calculationMap);
                    String content = this.getKpisContent(kpi, managementMap);
                    XSSFCellStyle cellStyle = wb.createCellStyle();
                    cellStyle.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(kpi.getBgColor())));
                    cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
                    XSSFFont cellFont = wb.createFont();
                    cellFont.setBold(false);
                    cellFont.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(kpi.getFontColor())));
                    cellStyle.setFont(cellFont);
                    cellStyle.setWrapText(true);
                    cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
                    cellStyle.setBorderBottom(BorderStyle.THIN);
                    cellStyle.setBorderTop(BorderStyle.THIN);
                    cellStyle.setBorderRight(BorderStyle.THIN);
                    cellStyle.setBorderLeft(BorderStyle.THIN);
                    Cell contentCell1 = contentRow.createCell(cell++);
                    contentCell1.setCellValue("\n" + content);
                    contentCell1.setCellStyle(cellStyle);
                    if (i == 0) {
                        byte[] imgBytes = BscReportSupportUtils.getByteIconBase("KPI", kpi.getTarget(), kpi.getMin(), kpi.getScore(), kpi.getCompareType(), kpi.getManagement(), kpi.getQuasiRange());
                        if (null != imgBytes) {
                            SimpleUtils.setCellPicture(wb, sh, imgBytes, contentCell1.getRowIndex(), contentCell1.getColumnIndex());
                        }
                    }
                }
            }
        }
    }
    for (int px = 0; px < vision.getPerspectives().size(); px++) {
        PerspectiveVO perspective = vision.getPerspectives().get(px);
        sh.addMergedRegion(new CellRangeAddress(mrRow, mrRow + perspective.getRow() - 1, 0, 3));
        for (int ox = 0; ox < perspective.getObjectives().size(); ox++) {
            ObjectiveVO objective = perspective.getObjectives().get(ox);
            sh.addMergedRegion(new CellRangeAddress(mrRow, mrRow + objective.getRow() - 1, 4, 7));
            for (int kx = 0; kx < objective.getKpis().size(); kx++) {
                sh.addMergedRegion(new CellRangeAddress(mrRow + kx, mrRow + kx, 8, 11));
            }
            mrRow += objective.getKpis().size();
        }
    }
    return row++;
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) XSSFColor(org.apache.poi.xssf.usermodel.XSSFColor) XSSFCellStyle(org.apache.poi.xssf.usermodel.XSSFCellStyle) XSSFFont(org.apache.poi.xssf.usermodel.XSSFFont) Row(org.apache.poi.ss.usermodel.Row) CellRangeAddress(org.apache.poi.ss.util.CellRangeAddress) Cell(org.apache.poi.ss.usermodel.Cell)

Example 19 with XSSFFont

use of org.apache.poi.xssf.usermodel.XSSFFont in project bamboobsc by billchen198318.

the class KpiPeriodTrendsExcelCommand method putTables.

@SuppressWarnings("unchecked")
private void putTables(XSSFWorkbook wb, XSSFSheet sh, Context context) throws Exception {
    XSSFCellStyle cellHeadStyle = wb.createCellStyle();
    cellHeadStyle.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor("#f5f5f5")));
    cellHeadStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    cellHeadStyle.setBorderBottom(BorderStyle.THIN);
    cellHeadStyle.setBorderTop(BorderStyle.THIN);
    cellHeadStyle.setBorderRight(BorderStyle.THIN);
    cellHeadStyle.setBorderLeft(BorderStyle.THIN);
    XSSFFont cellHeadFont = wb.createFont();
    cellHeadFont.setBold(true);
    cellHeadStyle.setFont(cellHeadFont);
    sh.setColumnWidth(0, 12000);
    int row = 0;
    Row nowRow = sh.createRow(row);
    Cell cell1 = nowRow.createCell(0);
    cell1.setCellStyle(cellHeadStyle);
    cell1.setCellValue("KPI");
    Cell cell2 = nowRow.createCell(1);
    cell2.setCellStyle(cellHeadStyle);
    cell2.setCellValue("Maximum");
    Cell cell3 = nowRow.createCell(2);
    cell3.setCellStyle(cellHeadStyle);
    cell3.setCellValue("Target");
    Cell cell4 = nowRow.createCell(3);
    cell4.setCellStyle(cellHeadStyle);
    cell4.setCellValue("Minimum");
    Cell cell5 = nowRow.createCell(4);
    cell5.setCellStyle(cellHeadStyle);
    cell5.setCellValue("Current score");
    Cell cell6 = nowRow.createCell(5);
    cell6.setCellStyle(cellHeadStyle);
    cell6.setCellValue("Previous score");
    Cell cell7 = nowRow.createCell(6);
    cell7.setCellStyle(cellHeadStyle);
    cell7.setCellValue("Change(%)");
    row++;
    List<PeriodTrendsData<KpiVO>> periodDatas = (List<PeriodTrendsData<KpiVO>>) context.get("periodDatas");
    for (PeriodTrendsData<KpiVO> periodData : periodDatas) {
        nowRow = sh.createRow(row);
        cell1 = nowRow.createCell(0);
        cell1.setCellValue(periodData.getCurrent().getName());
        cell2 = nowRow.createCell(1);
        cell2.setCellValue(periodData.getCurrent().getMax());
        cell3 = nowRow.createCell(2);
        cell3.setCellValue(periodData.getCurrent().getTarget());
        cell4 = nowRow.createCell(3);
        cell4.setCellValue(periodData.getCurrent().getMin());
        cell5 = nowRow.createCell(4);
        cell5.setCellValue(BscReportSupportUtils.parse2(periodData.getCurrent().getScore()));
        cell6 = nowRow.createCell(5);
        cell6.setCellValue(BscReportSupportUtils.parse2(periodData.getPrevious().getScore()));
        cell7 = nowRow.createCell(6);
        cell7.setCellValue(BscReportSupportUtils.parse2(periodData.getChange()));
        row++;
    }
    nowRow = sh.createRow(row);
    cell1 = nowRow.createCell(0);
    cell1.setCellValue("Current period: " + (String) context.get("currentPeriodDateRange") + " , Previous period: " + (String) context.get("previousPeriodDateRange"));
}
Also used : XSSFColor(org.apache.poi.xssf.usermodel.XSSFColor) XSSFCellStyle(org.apache.poi.xssf.usermodel.XSSFCellStyle) PeriodTrendsData(com.netsteadfast.greenstep.bsc.model.PeriodTrendsData) XSSFFont(org.apache.poi.xssf.usermodel.XSSFFont) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) List(java.util.List) Row(org.apache.poi.ss.usermodel.Row) Cell(org.apache.poi.ss.usermodel.Cell)

Example 20 with XSSFFont

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

the class FxExcelUtil method style.

/**
	 * 셀 스타일 처리.
	 * @작성자 : KYJ
	 * @작성일 : 2016. 9. 8. 
	 * @param cell
	 * @param defaultStyle 
	 *    전역적으로 설정할 디폴트 스타일
	 * @param options
	 */
static void style(Cell cell, Consumer<XSSFCellStyle> defaultStyle, Consumer<XSSFCellStyle> options) {
    Workbook workbook = cell.getSheet().getWorkbook();
    XSSFCellStyle style = (XSSFCellStyle) workbook.createCellStyle();
    //default style.
    defaultStyle.accept(style);
    /*
		 * 2016-09-09 싱글톤형태로 사용시 에러발생. 내부적으로 생성하고 관리해야함.
		 */
    //		if (DEFAULT_FONT == null) {
    XSSFFont DEFAULT_FONT = (XSSFFont) workbook.createFont();
    DEFAULT_FONT.setColor(DEFAULT_HEADER_FONT_COLOR);
    DEFAULT_FONT.setBold(true);
    //		}
    style.setFont(DEFAULT_FONT);
    if (options != null)
        options.accept(style);
    cell.setCellStyle(style);
}
Also used : XSSFCellStyle(org.apache.poi.xssf.usermodel.XSSFCellStyle) XSSFFont(org.apache.poi.xssf.usermodel.XSSFFont) XSSFWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook) Workbook(org.apache.poi.ss.usermodel.Workbook)

Aggregations

XSSFFont (org.apache.poi.xssf.usermodel.XSSFFont)27 XSSFCellStyle (org.apache.poi.xssf.usermodel.XSSFCellStyle)22 Cell (org.apache.poi.ss.usermodel.Cell)17 Row (org.apache.poi.ss.usermodel.Row)17 XSSFColor (org.apache.poi.xssf.usermodel.XSSFColor)17 CellRangeAddress (org.apache.poi.ss.util.CellRangeAddress)13 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 XSSFWorkbook (org.apache.poi.xssf.usermodel.XSSFWorkbook)4 BufferedImage (java.awt.image.BufferedImage)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 HashMap (java.util.HashMap)3 XSSFCell (org.apache.poi.xssf.usermodel.XSSFCell)3 XSSFRow (org.apache.poi.xssf.usermodel.XSSFRow)3 XSSFCellBorder (org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder)3 XSSFCellFill (org.apache.poi.xssf.usermodel.extensions.XSSFCellFill)3