for (PdfPCell pdfPCell : groupTitleCell) {
pdfPCell.setBorder(Rectangle.NO_BORDER);
pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
}
PdfPTable titleTable = new PdfPTable(1);
titleTable.setWidthPercentage(100f);
titleTable.setWidths(wfTitle);
addCellsToTable(titleTable,groupTitleCell);
addContent(titleTable);
//Add Group Header
PdfPCell[] groupHeaderCell = new PdfPCell[3];
groupHeaderCell[0] = new PdfPCell();
groupHeaderCell[0].setBorder(Rectangle.NO_BORDER);
groupHeaderCell[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.quante", null, localtion), contentBoldFont));
groupHeaderCell[1].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
groupHeaderCell[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.montant", null, localtion), contentBoldFont));
groupHeaderCell[2].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
float[] wfGroupHeader = {
10,
70,
20
};
for (PdfPCell pdfPCell : groupHeaderCell) {
pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
}
PdfPTable groupHeaderTable = new PdfPTable(3);
groupHeaderTable.setWidthPercentage(100f);
groupHeaderTable.setWidths(wfGroupHeader);
addCellsToTable(groupHeaderTable,groupHeaderCell);
addContent(groupHeaderTable);
String[] arrPrestations = prestations.split(Constants.SEPRATE);
//create table header
PdfPCell[] deductionTableHeader = new PdfPCell[10];
deductionTableHeader[0] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.date",null,localtion), contentBoldFont));
deductionTableHeader[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.canto",null,localtion) + arrPrestations[0], contentBoldFont));
deductionTableHeader[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.badge",null,localtion) + arrPrestations[1], contentBoldFont));
deductionTableHeader[3] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.grue",null,localtion) + arrPrestations[2], contentBoldFont));
deductionTableHeader[4] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.lift",null,localtion) + arrPrestations[3], contentBoldFont));
deductionTableHeader[5] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.bene",null,localtion) + arrPrestations[4], contentBoldFont));
deductionTableHeader[6] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.nettoyage",null,localtion) + arrPrestations[5], contentBoldFont));
deductionTableHeader[7] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.autres",null,localtion), contentBoldFont));
deductionTableHeader[8] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.prorata",null,localtion) + arrPrestations[6], contentBoldFont));
deductionTableHeader[9] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.refacturations",null,localtion), contentBoldFont));
for (PdfPCell pdfPCell : deductionTableHeader) {
pdfPCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
}
PdfPTable deductionTable = new PdfPTable(10);
//Add Header
addCellsToTable(deductionTable, deductionTableHeader);
//Add Content
String[] tmp = deductions.split(Constants.SEPRATE);
for(int i=0;i<tmp.length;i++){
deductionTable.addCell(new PdfPCell(new Phrase(tmp[i], contentNormalFont)));
}
float[] wf = {
10, //Libellé risque codification
10, //Origine de détection
10, //CR 3
10, // Niveau de risque 5
10,
10,
10,
10,
10,
10
};
deductionTable.setWidthPercentage(100f);
deductionTable.setWidths(wf);
return deductionTable;
}