addContent(table);
}
private void addGrid3() throws DocumentException{
//Title
PdfPTable titleTable = new PdfPTable(1);
titleTable.setWidthPercentage(100f);
PdfPCell titleCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.synthesedestranfpertpp", null, localtion), contentBoldFont));
titleCell.setBorder(Rectangle.NO_BORDER);
titleCell.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
titleTable.addCell(titleCell);
addContent(titleTable);
//Header
PdfPTable headerTable = new PdfPTable(7);
headerTable.setWidthPercentage(100f);
PdfPCell[] headerCell = new PdfPCell[7];
headerCell[0] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.libelle", null, localtion), contentBoldFont));
headerCell[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.objecif", null, localtion), contentBoldFont));
headerCell[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.obj", null, localtion), contentBoldFont));
headerCell[3] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.+-", null, localtion), contentBoldFont));
headerCell[4] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.rd", null, localtion), contentBoldFont));
headerCell[5] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.ts", null, localtion), contentBoldFont));
headerCell[6] = new PdfPCell(new Phrase("Total", contentBoldFont));
for (PdfPCell pdfPCell : headerCell) {
pdfPCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
}
addCellsToTable(headerTable, headerCell);
addContent(headerTable);
//Content
PdfPTable grid3Table = new PdfPTable(7);
grid3Table.setWidthPercentage(100f);
String[] arrGrid3 = grid3.split(Constants.SEPRATE);
String tmp;
for (int i=0;i<arrGrid3.length;i++) {
tmp = arrGrid3[i];
grid3Table.addCell(new PdfPCell(new Phrase(tmp.equals("null") ? "" : tmp , contentNormalFont)));
grid3Table.setWidthPercentage(100f);
}
addContent(grid3Table);
}