Example usage for org.apache.poi.ss.usermodel IndexedColors TAN

List of usage examples for org.apache.poi.ss.usermodel IndexedColors TAN

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel IndexedColors TAN.

Prototype

IndexedColors TAN

To view the source code for org.apache.poi.ss.usermodel IndexedColors TAN.

Click Source Link

Usage

From source file:guru.qas.martini.report.DefaultState.java

License:Apache License

public void colorRowsByStatus() {
    Map<String, Collection<Cell>> statusMap = statii.asMap();
    for (Map.Entry<String, Collection<Cell>> mapEntry : statusMap.entrySet()) {
        String status = mapEntry.getKey();

        Short color = null;/* w  w  w.j a  v  a2 s. c  o  m*/
        switch (status) {
        case "SKIPPED":
            color = IndexedColors.TAN.getIndex();
            break;
        case "PASSED":
            color = IndexedColors.LIME.getIndex();
            break;
        case "FAILED":
            color = IndexedColors.ROSE.getIndex();
            break;
        }

        if (null != color) {
            Collection<Cell> statusCells = mapEntry.getValue();
            colorRows(color, statusCells);
        }
    }
}

From source file:nc.noumea.mairie.appock.services.impl.ExportExcelServiceImpl.java

License:Open Source License

private void construitEnteteNumeroMarcheEtSoldeCommande(Workbook wb, Map<Service, List<ArticleDemande>> map,
        AbstractEntity abstractEntity, Service service, Sheet sheet) {
    Row row = createRowGeneric(sheet, LIGNE_NUMERO_MARCHE_ET_SOLDE_COMMANDE, 500);
    Cell cell = row.createCell(0);/*from  w ww.ja  v a 2 s.  co m*/
    if (abstractEntity instanceof SousMarche) {
        cell.setCellValue("March Nouma n: " + ((SousMarche) abstractEntity).getNumero());
        cell.setCellStyle(createCellWithBorderAndColor(wb, BorderStyle.THIN, IndexedColors.TAN, false));
    }

    // Cell Montant de la commande
    cell = row.createCell(6);

    int prixTotalService = 0;
    for (ArticleDemande articleDemande : map.get(service)) {
        prixTotalService += articleDemande.getTotalPrixCommande();
    }
    cell.setCellValue(prixTotalService);
    CellStyle style = createCellWithBorderAndColor(wb, BorderStyle.THIN, null, false);
    style.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0"));
    cell.setCellStyle(style);
}

From source file:nc.noumea.mairie.appock.services.impl.ExportExcelServiceImpl.java

License:Open Source License

private void construitEnteteArticle(Workbook wb, Sheet sheet) {
    Row row = createRowGeneric(sheet, 8, 500);
    row.createCell(0).setCellValue("Rfrence");
    row.createCell(1).setCellValue("Dsignation");
    row.createCell(2).setCellValue("Prix");
    row.createCell(3).setCellValue("Colisage");
    row.createCell(4).setCellValue("Commande");
    row.createCell(5).setCellValue("Total");

    CellStyle style = createCellWithBorderAndColor(wb, BorderStyle.THIN, IndexedColors.TAN, false);

    row.getCell(0).setCellStyle(style);/*ww  w  .  j  a va2s  .  c om*/
    row.getCell(1).setCellStyle(style);
    row.getCell(2).setCellStyle(style);
    row.getCell(3).setCellStyle(style);
    row.getCell(4).setCellStyle(style);
    row.getCell(5).setCellStyle(style);
}