Search in sources :

Example 6 with Phrase

use of com.itextpdf.text.Phrase in project saga by timurstrekalov.

the class PdfReporter method createFooter.

private Element createFooter() {
    final Paragraph footer = new Paragraph();
    footer.add(new Phrase("Generated using ", FONT_FOOTER));
    final Anchor a = new Anchor(config.getProperty("app.name"), FONT_FOOTER);
    a.setReference("http://timurstrekalov.github.com/saga/");
    footer.add(a);
    footer.add(new Phrase(" version " + config.getProperty("app.version"), FONT_FOOTER));
    footer.setAlignment(Element.ALIGN_RIGHT);
    return footer;
}
Also used : Anchor(com.itextpdf.text.Anchor) Phrase(com.itextpdf.text.Phrase) Paragraph(com.itextpdf.text.Paragraph)

Example 7 with Phrase

use of com.itextpdf.text.Phrase in project bamboobsc by billchen198318.

the class KpiReportPdfCommand method createHead.

private void createHead(PdfPTable table, VisionVO vision) throws Exception {
    PdfPCell cell = new PdfPCell();
    cell.addElement(new Phrase(vision.getTitle() + "\n" + BscReportSupportUtils.parse2(vision.getScore()), this.getFont(vision.getFontColor(), true)));
    this.setCellBackgroundColor(cell, vision.getBgColor());
    cell.setColspan(MAX_COLSPAN);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(BscReportPropertyUtils.getPerspectiveTitle(), this.getFont(BscReportPropertyUtils.getFontColor(), true)));
    this.setCellBackgroundColor(cell, BscReportPropertyUtils.getBackgroundColor());
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(BscReportPropertyUtils.getObjectiveTitle(), this.getFont(BscReportPropertyUtils.getFontColor(), true)));
    this.setCellBackgroundColor(cell, BscReportPropertyUtils.getBackgroundColor());
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(BscReportPropertyUtils.getKpiTitle(), this.getFont(BscReportPropertyUtils.getFontColor(), true)));
    this.setCellBackgroundColor(cell, BscReportPropertyUtils.getBackgroundColor());
    table.addCell(cell);
}
Also used : PdfPCell(com.itextpdf.text.pdf.PdfPCell) Phrase(com.itextpdf.text.Phrase)

Example 8 with Phrase

use of com.itextpdf.text.Phrase in project bamboobsc by billchen198318.

the class KpiReportPdfCommand method createBody.

private void createBody(PdfPTable table, VisionVO vision) throws Exception {
    Map<String, String> managementMap = BscKpiCode.getManagementMap(false);
    //Map<String, String> calculationMap = BscKpiCode.getCalculationMap(false);		
    PdfPCell cell = null;
    for (PerspectiveVO perspective : vision.getPerspectives()) {
        Image pImage = Image.getInstance(BscReportSupportUtils.getByteIconBase("PERSPECTIVES", perspective.getTarget(), perspective.getMin(), perspective.getScore(), "", "", 0));
        pImage.setWidthPercentage(10f);
        String content = this.getItemsContent(perspective.getName(), perspective.getScore(), perspective.getWeight(), perspective.getTarget(), perspective.getMin());
        cell = new PdfPCell();
        cell.addElement(pImage);
        cell.addElement(new Phrase("\n" + content, this.getFont(perspective.getFontColor(), false)));
        this.setCellBackgroundColor(cell, perspective.getBgColor());
        cell.setRowspan(perspective.getRow());
        table.addCell(cell);
        for (ObjectiveVO objective : perspective.getObjectives()) {
            Image oImage = Image.getInstance(BscReportSupportUtils.getByteIconBase("OBJECTIVES", objective.getTarget(), objective.getMin(), objective.getScore(), "", "", 0));
            oImage.setWidthPercentage(10f);
            content = this.getItemsContent(objective.getName(), objective.getScore(), objective.getWeight(), objective.getTarget(), objective.getMin());
            cell = new PdfPCell();
            cell.addElement(oImage);
            cell.addElement(new Phrase("\n" + content, this.getFont(objective.getFontColor(), false)));
            this.setCellBackgroundColor(cell, objective.getBgColor());
            cell.setRowspan(objective.getRow());
            table.addCell(cell);
            for (KpiVO kpi : objective.getKpis()) {
                /*
					content = this.getKpisContent(
							kpi, 
							managementMap, 
							calculationMap);	
					*/
                Image kImage = Image.getInstance(BscReportSupportUtils.getByteIconBase("KPI", kpi.getTarget(), kpi.getMin(), kpi.getScore(), kpi.getCompareType(), kpi.getManagement(), kpi.getQuasiRange()));
                kImage.setWidthPercentage(10f);
                content = this.getKpisContent(kpi, managementMap);
                cell = new PdfPCell();
                cell.addElement(kImage);
                cell.addElement(new Phrase("\n" + content, this.getFont(kpi.getFontColor(), false)));
                this.setCellBackgroundColor(cell, kpi.getBgColor());
                table.addCell(cell);
            }
        }
    }
}
Also used : PdfPCell(com.itextpdf.text.pdf.PdfPCell) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) Phrase(com.itextpdf.text.Phrase) BufferedImage(java.awt.image.BufferedImage) Image(com.itextpdf.text.Image)

Example 9 with Phrase

use of com.itextpdf.text.Phrase in project bamboobsc by billchen198318.

the class OrganizationReportPdfCommand method createBody.

private void createBody(PdfPTable table, VisionVO vision) throws Exception {
    String bgColor = "#ffffff";
    String fnColor = "#000000";
    PdfPCell cell = null;
    for (PerspectiveVO perspective : vision.getPerspectives()) {
        cell = new PdfPCell();
        cell.addElement(new Phrase(perspective.getName(), this.getFont(fnColor, false)));
        this.setCellBackgroundColor(cell, bgColor);
        cell.setRowspan(perspective.getRow());
        table.addCell(cell);
        for (ObjectiveVO objective : perspective.getObjectives()) {
            cell = new PdfPCell();
            cell.addElement(new Phrase(objective.getName(), this.getFont(fnColor, false)));
            this.setCellBackgroundColor(cell, bgColor);
            cell.setRowspan(objective.getRow());
            table.addCell(cell);
            for (KpiVO kpi : objective.getKpis()) {
                cell = new PdfPCell();
                cell.addElement(new Phrase(kpi.getName(), this.getFont(fnColor, false)));
                this.setCellBackgroundColor(cell, bgColor);
                cell.setRowspan(1);
                table.addCell(cell);
                cell = new PdfPCell();
                cell.addElement(new Phrase(kpi.getWeight() + "%", this.getFont(fnColor, false)));
                this.setCellBackgroundColor(cell, bgColor);
                cell.setRowspan(1);
                table.addCell(cell);
                cell = new PdfPCell();
                cell.addElement(new Phrase("max: " + kpi.getMax() + "\n" + "target: " + kpi.getTarget() + "\n" + "min: " + kpi.getMin() + "\n" + "unit: " + kpi.getUnit(), this.getFont(fnColor, false)));
                this.setCellBackgroundColor(cell, bgColor);
                cell.setRowspan(1);
                table.addCell(cell);
                DateRangeScoreVO dateRangeScore = kpi.getDateRangeScores().get(0);
                cell = new PdfPCell();
                cell.addElement(new Phrase(BscReportSupportUtils.parse2(dateRangeScore.getScore()), this.getFont(dateRangeScore.getFontColor(), false)));
                this.setCellBackgroundColor(cell, dateRangeScore.getBgColor());
                cell.setRowspan(1);
                table.addCell(cell);
            }
        }
    }
}
Also used : PdfPCell(com.itextpdf.text.pdf.PdfPCell) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) DateRangeScoreVO(com.netsteadfast.greenstep.vo.DateRangeScoreVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) Phrase(com.itextpdf.text.Phrase)

Example 10 with Phrase

use of com.itextpdf.text.Phrase in project bamboobsc by billchen198318.

the class PersonalReportPdfCommand method createFoot.

private void createFoot(PdfPTable table, Context context) throws Exception {
    String bgColor = "#ffffff";
    String fnColor = "#000000";
    PdfPCell cell = new PdfPCell();
    cell.addElement(new Phrase("assess:", this.getFont(fnColor, true)));
    cell.setColspan(1);
    cell.setRowspan(2);
    cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    this.setCellBackgroundColor(cell, bgColor);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(BscReportPropertyUtils.getPersonalReportClassLevel(), this.getFont(fnColor, true)));
    cell.setColspan(3);
    cell.setRowspan(2);
    cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    this.setCellBackgroundColor(cell, bgColor);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("Total", this.getFont(fnColor, true)));
    cell.setColspan(1);
    cell.setRowspan(1);
    cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    this.setCellBackgroundColor(cell, bgColor);
    table.addCell(cell);
    float total = 0.0f;
    if (context.get("total") != null && context.get("total") instanceof Float) {
        total = (Float) context.get("total");
    }
    cell = new PdfPCell();
    cell.addElement(new Phrase(BscReportSupportUtils.parse2(total), this.getFont(fnColor, true)));
    cell.setColspan(1);
    cell.setRowspan(1);
    cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    this.setCellBackgroundColor(cell, bgColor);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase("Class", this.getFont(fnColor, true)));
    cell.setColspan(1);
    cell.setRowspan(1);
    cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    this.setCellBackgroundColor(cell, bgColor);
    table.addCell(cell);
    cell = new PdfPCell();
    cell.addElement(new Phrase(" ", this.getFont(fnColor, true)));
    cell.setColspan(1);
    cell.setRowspan(1);
    cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
    cell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    this.setCellBackgroundColor(cell, bgColor);
    table.addCell(cell);
}
Also used : PdfPCell(com.itextpdf.text.pdf.PdfPCell) Phrase(com.itextpdf.text.Phrase)

Aggregations

Phrase (com.itextpdf.text.Phrase)10 PdfPCell (com.itextpdf.text.pdf.PdfPCell)8 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)4 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)4 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)4 DateRangeScoreVO (com.netsteadfast.greenstep.vo.DateRangeScoreVO)3 Image (com.itextpdf.text.Image)2 BufferedImage (java.awt.image.BufferedImage)2 ScriptCoverageStatistics (com.github.timurstrekalov.saga.core.model.ScriptCoverageStatistics)1 Anchor (com.itextpdf.text.Anchor)1 BaseColor (com.itextpdf.text.BaseColor)1 Chunk (com.itextpdf.text.Chunk)1 Font (com.itextpdf.text.Font)1 Paragraph (com.itextpdf.text.Paragraph)1 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)1 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)1 HashMap (java.util.HashMap)1