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;
}
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);
}
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);
}
}
}
}
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);
}
}
}
}
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);
}
Aggregations