Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfPCell


    return grid3Table;
  }
 
  private PdfPTable addProcessCommantaire() throws DocumentException{
    PdfPTable commantaireTable = new PdfPTable(1);
    PdfPCell pdfPCell = new PdfPCell(new Phrase(commentaire.equals("null") ? "" : commentaire, contentNormalFont));
    pdfPCell.setBorder(Rectangle.NO_BORDER);
    commantaireTable.addCell(pdfPCell)
    float[] wf = {
        15
      };
    commantaireTable.setWidths(wf);
View Full Code Here


    //Add total deduction
    PdfPTable totalTable = addTotalDeduction();
    addContent(totalTable);
    lineBreak();
   
    PdfPCell leftCell,middleCell,rightCell;
    PdfPTable parent = new PdfPTable(3);
    parent.setSpacingBefore(0f);
    parent.setWidthPercentage(100f);
    float[] wfParent = {
        70//Libellé risque codification
        5,   //Origine de détection
        25
      };
    parent.setWidths(wfParent);

    //Add Penalties
    leftCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.penalites", null, localtion),contentBoldFont));
    leftCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(leftCell);
   
    middleCell = new PdfPCell();
    middleCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(middleCell);
   
    rightCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.comment", null, localtion),contentBoldFont));
    rightCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(rightCell);
   
   
    PdfPTable penaltyTable = addPenaltiesTable();
    leftCell = new PdfPCell(penaltyTable);
    parent.addCell(leftCell);
   
    middleCell = new PdfPCell();
    middleCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(middleCell);
   
    PdfPTable commentairePdfPTable = addDeductionCommantaire();
    rightCell = new PdfPCell(commentairePdfPTable);
    parent.addCell(rightCell);
   
    leftCell = new PdfPCell(addAmountTable());
    parent.addCell(leftCell);
   
    middleCell = new PdfPCell();
    middleCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(middleCell);
   
    rightCell = new PdfPCell();
    rightCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(rightCell);
 
    addContent(parent);
   
View Full Code Here

  }*/
 
  private PdfPTable addDeductionTable() throws DocumentException {
    //Title
    PdfPCell[] groupTitleCell = new PdfPCell[1];
    groupTitleCell[0] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.retenuesEffectuees", null, localtion),contentBoldFont))
    float[] wfTitle = {
        100
      };
    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);
   
   
    //create table header
    String[] arrPrestations = prestations.split(Constants.SEPRATE);
    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
    if(deductions!=null && deductions.length() > 0){
      deductions = deductions.substring(0,deductions.length() - 1);
    }
    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,
        10,
View Full Code Here

   
    PdfPTable totalDeduction = new PdfPTable(10);
    String[] tmp = totaldeduction.split(Constants.SEPRATE);
    for(int i=0; i < tmp.length ; i++){
      if(i == 0){
        totalDeduction.addCell(new PdfPCell(new Phrase(messageSource.getMessage("FicheST.total", null, localtion), contentBoldFont)));
      }
      totalDeduction.addCell(new PdfPCell(new Phrase(tmp[i], contentBoldFont)));
    }
    float[] wf = {
        10,
        10,
        10,
View Full Code Here

 
  private PdfPTable addPenaltiesTable() throws DocumentException {
    //create table header
   
    PdfPCell[] grid3TableHeader = new PdfPCell[3];
    grid3TableHeader[0] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.date",null,localtion), contentBoldFont))
    grid3TableHeader[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.penalties.montant",null,localtion), contentBoldFont));
    grid3TableHeader[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.penalties.commentaires",null,localtion), contentBoldFont));
   
    for (PdfPCell pdfPCell : grid3TableHeader) {
      pdfPCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    PdfPTable penlatyTable = new PdfPTable(3);
    addCellsToTable(penlatyTable, grid3TableHeader);
   
    //penaltys = penaltys.replace("?"," ");
    String[] tmp = penaltys.split(Constants.SEPRATE);
   
    for(int i=0; i < tmp.length ; i++){
      penlatyTable.addCell(new PdfPCell(new Phrase(tmp[i].equals("null") ? "" : tmp[i], contentNormalFont)));
   
    float[] wf = {
        15,
        15,
        15
View Full Code Here

  }
 
  private PdfPTable addAmountTable() throws DocumentException {

    PdfPTable amountTable = new PdfPTable(3);
    PdfPCell amountCell;
    String[] tmp = amount.split(Constants.SEPRATE);
   
    for(int i=0; i < tmp.length ; i++){
      if(i == 0){
        amountCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.total", null, localtion), contentBoldFont));
        amountCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
        amountTable.addCell(amountCell);
      }
      amountCell = new PdfPCell(new Phrase(tmp[i], contentNormalFont));
      amountCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
      amountTable.addCell(amountCell);
     
      amountCell = new PdfPCell();
      amountCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
      amountTable.addCell(amountCell);
   
    float[] wf = {
        15,
        15,
View Full Code Here

  }
 
  private PdfPTable addDeductionCommantaire() throws DocumentException{
    //create table header
    PdfPCell[] commantaireTableHeader = new PdfPCell[1];
    commantaireTableHeader[0] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.comment2", null,localtion)+" : ", contentBoldFont));
    for (PdfPCell pdfPCell : commantaireTableHeader) {
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
 
    PdfPTable commantaireTable = new PdfPTable(1);
    deductionComment1 = deductionComment1.equals("null") ? "" : deductionComment1;
    deductionComment2 = deductionComment2.equals("null") ? "" : deductionComment2;
    PdfPCell pdfPCell = new PdfPCell(new Phrase(deductionComment1 + "\n" + deductionComment2, contentNormalFont));
    pdfPCell.setBorder(Rectangle.NO_BORDER);
    commantaireTable.addCell(pdfPCell)
    float[] wf = {
        15
      };
    commantaireTable.setWidths(wf);
View Full Code Here

  private void addAllFichestDto() throws DocumentException {
    //Title
    PdfPTable headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
   
    PdfPCell headerCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.allfichest.fichedesuividusoustraitant", null, localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerCell.setHorizontalAlignment(PdfPTable.ALIGN_CENTER);
    headerTable.addCell(headerCell);
   
    addContent(headerTable);
   
    //Information Generals
    headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
    headerCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.generalInformation", null, localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerCell.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    headerTable.addCell(headerCell);

    addContent(headerTable);
 
    // Information Details
    String arrGeneraleInformation[]= generaleInformation.split(Constants.SEPRATE);
    PdfPTable generaleInformationTable = new PdfPTable(6);
    PdfPCell generaleInformationCell;
    generaleInformationTable.setWidthPercentage(100f);
    //String [] messages = {"Chantier : ","Lot : ","Conducteur de travaux : ","Société : ","Type de lot : ","Montant objectif:"};
    String [] messages = {messageSource.getMessage("FicheST.chantier",null, localtion) + " : ",messageSource.getMessage("FicheST.lot", null, localtion) + " : ",
        messageSource.getMessage("FicheST.foreman", null, localtion) + " : ",
        messageSource.getMessage("pdf.synthese.societe", null, localtion) + " : ",messageSource.getMessage("FicheST.lotType", null, localtion) + " : ",
        messageSource.getMessage("pdf.gestiondto.montantobjectif",null,localtion) + " : "};
    for(int i=0;i<arrGeneraleInformation.length;i++){
      switch (i) {
        case 0
          generaleInformationCell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationCell.enableBorderSide(Rectangle.LEFT);
          generaleInformationTable.addCell(generaleInformationCell);
         
          break;
        case 1
          generaleInformationCell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 2
          generaleInformationCell = new PdfPCell(new Phrase(messages[2], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 3
          generaleInformationCell = new PdfPCell(new Phrase(messages[3], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationCell.enableBorderSide(Rectangle.LEFT);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 4
          generaleInformationCell = new PdfPCell(new Phrase(messages[4], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 5
          generaleInformationCell = new PdfPCell(new Phrase(messages[5], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
      }
      generaleInformationCell = new PdfPCell(new Phrase(arrGeneraleInformation[i].equals("null") ? "" : arrGeneraleInformation[i], contentNormalFont));
      if(i == 0 || i == 1 || i == 2){
        generaleInformationCell.setBorder(Rectangle.NO_BORDER);
        generaleInformationCell.enableBorderSide(Rectangle.TOP);
        if(i == 2)
          generaleInformationCell.enableBorderSide(Rectangle.RIGHT);
        generaleInformationTable.addCell(generaleInformationCell);
      }
      if(i == 3 || i == 4 || i == 5){
        generaleInformationCell.setBorder(Rectangle.NO_BORDER);
        generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
        if(i == 5)
          generaleInformationCell.enableBorderSide(Rectangle.RIGHT);
        generaleInformationTable.addCell(generaleInformationCell);
      }
    }
    float[] wfGeneraleInformation = {
        3,
        6,
        3,
        6,
        7,
        6
      };
    generaleInformationTable.setWidths(wfGeneraleInformation);
    addContent(generaleInformationTable);
    lineBreak();
   
    PdfPCell leftCell,spaceCell1,middleCell,spaceCell2,rightCell;
    PdfPTable parent = new PdfPTable(5);
    parent.setSpacingBefore(0f);
    parent.setWidthPercentage(100f);
    float[] wfParent = {
        25,
        5,
        25,
        5,
        40
      };
    parent.setWidths(wfParent);

    //Add Condition
    leftCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.conditions", null, localtion),contentBoldFont));
    leftCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(leftCell);
   
    spaceCell1 = new PdfPCell();
    spaceCell1.setBorder(Rectangle.NO_BORDER);
    parent.addCell(spaceCell1);
   
    middleCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.prestations", null, localtion),contentBoldFont));
    middleCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(middleCell);
   
    spaceCell2 = new PdfPCell();
    spaceCell2.setBorder(Rectangle.NO_BORDER);
    parent.addCell(spaceCell2);

    rightCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.informationComplementaries", null, localtion), contentBoldFont));
    rightCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(rightCell);
   
    //Add content
    PdfPTable conditionTable = addConditions();
    leftCell = new PdfPCell(conditionTable);
    parent.addCell(leftCell);
   
    spaceCell1 = new PdfPCell();
    spaceCell1.setBorder(Rectangle.NO_BORDER);
    parent.addCell(spaceCell1);
   
    PdfPTable prestations = addPrestations();
    middleCell = new PdfPCell(prestations);
    middleCell.setBorder(Rectangle.NO_BORDER);
    parent.addCell(middleCell);
   
    spaceCell2 = new PdfPCell();
    spaceCell2.setBorder(Rectangle.NO_BORDER);
    parent.addCell(spaceCell2);
   
    PdfPTable caution = addCaution();
    rightCell = new PdfPCell(caution);
    parent.addCell(rightCell);

    addContent(parent)
    lineBreak();
    if(hasGestion != null && hasGestion.equals("true")){
View Full Code Here

   * [2]: bottom
   * [3]: left
   * [4]: right
   */
  public void addTableCell(PdfPTable table, Element content, int border, int colSpan, Float... padding) {
    PdfPCell contentCell = new PdfPCell();
    contentCell.setColspan(colSpan);
    contentCell.setBorder(border);
    if (padding != null) {
      int len = padding.length;
      if (padding[0] != null) {
        contentCell.setPadding(padding[0].floatValue());       
      }
      if (len > 1 && padding[1] != null) {
        contentCell.setPaddingTop(padding[1].floatValue());       
      }
      if (len > 2 && padding[2] != null) {
        contentCell.setPaddingBottom(padding[2].floatValue());       
      }
      if (len > 3 && padding[3] != null) {
        contentCell.setPaddingLeft(padding[3].floatValue());       
      }
      if (len > 4 && padding[4] != null) {
        contentCell.setPaddingLeft(padding[4].floatValue());       
      }
    }
    contentCell.addElement(content);
    table.addCell(contentCell);
  }
View Full Code Here

  private void addProcessDto() throws DocumentException {   
    //Title
    PdfPTable headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
   
    PdfPCell headerCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.suividesavancementssusoustraitant", null, localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerCell.setHorizontalAlignment(PdfPTable.ALIGN_CENTER);
    headerTable.addCell(headerCell);
    addContent(headerTable);
   
    //Information Generals
    headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
    headerCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.generalInformation", null, localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerCell.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    headerTable.addCell(headerCell);
    addContent(headerTable);
 
    // Information Details
    String arrGeneraleInformation[]= generaleInformation.split(Constants.SEPRATE);
    PdfPTable generaleInformationTable = new PdfPTable(6);
    PdfPCell generaleInformationCell;
    generaleInformationTable.setWidthPercentage(100f);
    String [] messages = {messageSource.getMessage("FicheST.chantier",null, localtion) + " : ",messageSource.getMessage("FicheST.lot", null, localtion) + " : ",
        messageSource.getMessage("FicheST.foreman", null, localtion) + " : ",
        messageSource.getMessage("pdf.synthese.societe", null, localtion) + " : ",messageSource.getMessage("FicheST.lotType", null, localtion) + " : ",
        messageSource.getMessage("pdf.gestiondto.montantobjectif",null,localtion) + " : "};
    for(int i=0;i<arrGeneraleInformation.length;i++){
      switch (i) {
        case 0
          generaleInformationCell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationCell.enableBorderSide(Rectangle.LEFT);
          generaleInformationTable.addCell(generaleInformationCell);
         
          break;
        case 1
          generaleInformationCell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 2
          generaleInformationCell = new PdfPCell(new Phrase(messages[2], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.TOP);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 3
          generaleInformationCell = new PdfPCell(new Phrase(messages[3], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationCell.enableBorderSide(Rectangle.LEFT);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 4
          generaleInformationCell = new PdfPCell(new Phrase(messages[4], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
        case 5
          generaleInformationCell = new PdfPCell(new Phrase(messages[5], contentBoldFont));
          generaleInformationCell.setBorder(Rectangle.NO_BORDER);
          generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
          generaleInformationTable.addCell(generaleInformationCell);
          break;
      }
      generaleInformationCell = new PdfPCell(new Phrase(arrGeneraleInformation[i].equals("null") ? "" : arrGeneraleInformation[i], contentNormalFont));
      if(i == 0 || i == 1 || i == 2){
        generaleInformationCell.setBorder(Rectangle.NO_BORDER);
        generaleInformationCell.enableBorderSide(Rectangle.TOP);
        if(i == 2)
          generaleInformationCell.enableBorderSide(Rectangle.RIGHT);
        generaleInformationTable.addCell(generaleInformationCell);
      }
      if(i == 3 || i == 4 || i == 5){
        generaleInformationCell.setBorder(Rectangle.NO_BORDER);
        generaleInformationCell.enableBorderSide(Rectangle.BOTTOM);
        if(i == 5)
          generaleInformationCell.enableBorderSide(Rectangle.RIGHT);
        generaleInformationTable.addCell(generaleInformationCell);
      }
    }
    float[] wfGeneraleInformation = {
        3,
        6,
        3,
        6,
        7,
        6
      };
    generaleInformationTable.setWidths(wfGeneraleInformation);
    addContent(generaleInformationTable);
    lineBreak();
   
    headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
    headerTable.setSpacingAfter(15f);
    headerCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.suvidesavancements", null, localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerTable.addCell(headerCell);
    headerTable.setSpacingAfter(0f);
    addContent(headerTable);
   
    headerTable = new PdfPTable(2);
    headerTable.setWidthPercentage(40f);
    headerTable.setHorizontalAlignment(Rectangle.ALIGN_LEFT);
    headerTable.setSpacingAfter(15f);
    float[] wf1 = {
        5,10 };
    headerCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.etatdavancement", null, localtion) + " : ", contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerTable.addCell(headerCell);
   
    headerCell = new PdfPCell(new Phrase(etatAvancement + Constants.SPACE + messageSource.getMessage("pdf.process.titlebox.percentavancementmarche", null, localtion), contentNormalFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerTable.addCell(headerCell);
    headerTable.setSpacingAfter(0f);
    headerTable.setWidths(wf1);
    addContent(headerTable);
   
    PdfPTable parent = new PdfPTable(3);
    parent.setSpacingBefore(0f);
    parent.setWidthPercentage(100f);
    float[] wfParent = {
        70,
        5,
        25
      };
    parent.setWidths(wfParent);
    PdfPCell cellLeft,cellMiddle,cellRight;

    //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.titlebox.advancement", null, localtion), contentBoldFont));
    groupHeaderCell[1].setBackgroundColor(new Color(181,181,181));

    groupHeaderCell[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.retenues", null, localtion), contentBoldFont));
    groupHeaderCell[2].setBackgroundColor(new Color(181,181,181));
   
    float[] wfGroupHeader = {
        25,
        20,
        20
      };
    for (PdfPCell pdfPCell : groupHeaderCell) {
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }

    PdfPTable groupHeaderTable = new PdfPTable(3);
    groupHeaderTable.setWidthPercentage(100f);
    groupHeaderTable.setWidths(wfGroupHeader);
    addCellsToTable(groupHeaderTable,groupHeaderCell);
   
    cellLeft = new PdfPCell(groupHeaderTable);
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
   
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
   
    cellRight = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.comment2", null, localtion) + " : ", contentBoldFont));
    cellRight.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellRight);

    //Header
    //create table header
    PdfPCell[] processTableHeader = new PdfPCell[7];
    processTableHeader[0] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.number", null, localtion), contentBoldFont));
    processTableHeader[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.libelle", null, localtion), contentBoldFont));
    processTableHeader[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.date", null, localtion), contentBoldFont));
    processTableHeader[3] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.cumule", null, localtion), contentBoldFont));
    processTableHeader[4] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.mois", null, localtion), contentBoldFont));
    processTableHeader[5] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.cumule", null, localtion), contentBoldFont));
    processTableHeader[6] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.mois", null, localtion), contentBoldFont));
   
    for (PdfPCell pdfPCell : processTableHeader) {
      pdfPCell.setBackgroundColor(new Color(181,181,181));
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    //End
    PdfPTable processDtoTable = new PdfPTable(COL);
    processDtoTable.setWidthPercentage(100f);
    addCellsToTable(processDtoTable, processTableHeader);
   
    float[] wf = {
        5,   //No 3
        10//Libellé risque codification
        10,   //Origine de détection
        10,   //CR 3
        10// Niveau de risque 5
        10,
        10
      };
    processDtoTable.setWidthPercentage(70f);
    processDtoTable.setWidths(wf);
    processDtoTable.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);

    cellLeft = new PdfPCell(processDtoTable);
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
   
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
   
    parent.addCell(cellMiddle);
   
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.TOP);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
   
   
    processDtoTable.getDefaultCell().setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
   
    String tmp;
    processDtoTable = new PdfPTable(COL);
    if(processes!=null && processes.length() > 0){
      String arr[] = processes.split(Constants.SEPRATE);
      for(int i=0;i < arr.length;i++){
        tmp = arr[i];
        processDtoTable.addCell(new PdfPCell(new Phrase(tmp.equals("null") ? "" : tmp, contentNormalFont)));
      }
      processDtoTable.setWidthPercentage(70f);
      processDtoTable.setWidths(wf);
      processDtoTable.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    }
    cellLeft = new PdfPCell(processDtoTable);
    parent.addCell(cellLeft);
   
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
   
    PdfPTable commanttaire = addProcessCommantaire();
    commanttaire.setWidthPercentage(70f);
    cellRight = new PdfPCell(commanttaire);
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
    //Total Situation
    processDtoTable = addtotalsituation(totalsituation);
    processDtoTable.setWidthPercentage(70f);
    processDtoTable.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    cellLeft = new PdfPCell(processDtoTable);
    parent.addCell(cellLeft);
   
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
   
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
   
    //Space
    cellLeft = new PdfPCell();
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
   
    cellLeft = new PdfPCell();
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
   
    cellLeft = new PdfPCell();
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
    //End
   
   
    cellLeft = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.titlebox.detaildesretenuesappliques", null,localtion),contentBoldFont));
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
   
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
   
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
   
    processDtoTable = addGrid2(grid2);
    processDtoTable.setWidthPercentage(70f);
    processDtoTable.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    cellLeft = new PdfPCell(processDtoTable);
    parent.addCell(cellLeft);
   
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
   
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
   
    cellLeft = new PdfPCell();
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
   
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
   
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
    //Add Sapce
    //Space
    cellLeft = new PdfPCell();
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
   
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
   
    cellLeft = new PdfPCell();
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
   
    cellLeft = new PdfPCell();
    cellLeft.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellLeft);
    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    parent.addCell(cellRight);
    //End
   
    processDtoTable = addGrid3(grid3);
    processDtoTable.setWidthPercentage(70f);
    processDtoTable.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    cellLeft = new PdfPCell(processDtoTable);
    parent.addCell(cellLeft);

    cellMiddle = new PdfPCell();
    cellMiddle.setBorder(Rectangle.NO_BORDER);
    parent.addCell(cellMiddle);
   
    cellRight = new PdfPCell();
    cellRight.setBorder(Rectangle.NO_BORDER);
    cellRight.enableBorderSide(Rectangle.RIGHT);
    cellRight.enableBorderSide(Rectangle.LEFT);
    cellRight.enableBorderSide(Rectangle.BOTTOM);
    parent.addCell(cellRight);
View Full Code Here

TOP

Related Classes of com.lowagie.text.pdf.PdfPCell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.