Examples of PdfPCell


Examples of com.lowagie.text.pdf.PdfPCell

  }
 
  private PdfPTable addInformations() throws DocumentException {
 
    PdfPTable informationsTable = new PdfPTable(4);
    PdfPCell informatrionsCell = new PdfPCell();   
    //Add Content
    String[] tmp = informationscomplementaires.split(Constants.SEPRATE);
   
    String [] messages = {messageSource.getMessage("FicheST.conducteur", null, localtion) + " : ",messageSource.getMessage("pdf.allfichest.dateOfMarket", null, localtion) + " : "};
    for(int i=0;i<tmp.length;i++){
      switch (i) {
      case 0:
        informatrionsCell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
        informatrionsCell.setBorder(Rectangle.NO_BORDER);
        informationsTable.addCell(informatrionsCell);
        break;
      case 1:
        informatrionsCell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
        informatrionsCell.setBorder(Rectangle.NO_BORDER);
        informationsTable.addCell(informatrionsCell);
        break;
      }
      informatrionsCell = new PdfPCell(new Phrase(tmp[i].equals("null") ? "" : tmp[i] , contentNormalFont));
      informatrionsCell.setBorder(Rectangle.NO_BORDER);
      informationsTable.addCell(informatrionsCell);
    }
    float[] wf = {
        10,
        10,
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPCell

 
  private PdfPTable addCaution() throws DocumentException
   
    PdfPTable informations = addInformations();
    PdfPCell [] informationHeader = new PdfPCell[3];
    informationHeader[0] = new PdfPCell(informations);
    informationHeader[0].setBorder(Rectangle.NO_BORDER);
    informationHeader[0].enableBorderSide(Rectangle.TOP);
    informationHeader[0].enableBorderSide(Rectangle.LEFT);
    informationHeader[0].enableBorderSide(Rectangle.RIGHT);
   
    informationHeader[1] = new PdfPCell();
    informationHeader[1].setBorder(Rectangle.NO_BORDER);
    informationHeader[2] = new PdfPCell();
    informationHeader[2].setBorder(Rectangle.NO_BORDER);
    informationHeader[0].setColspan(2);
   
   
    PdfPCell [] cautionHeader = new PdfPCell[2];
    cautionHeader[0] = new PdfPCell(new Phrase("Date", contentBoldFont));
    cautionHeader[1] = new PdfPCell(new Phrase("Montant", contentBoldFont));
    for (PdfPCell pdfPCell : cautionHeader) {
      //pdfPCell.setBorder(Rectangle.NO_BORDER);
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    PdfPTable cautionTable = new PdfPTable(2);
    addCellsToTable(cautionTable, informationHeader);
    addCellsToTable(cautionTable, cautionHeader);
    PdfPCell cautionCell = new PdfPCell();   
    //Add Content
    String[] tmp = cautionFournies.split(Constants.SEPRATE);
    for(int i=0;i<tmp.length;i++){
      cautionCell = new PdfPCell(new Phrase(tmp[i].equals("null") ? "" : tmp[i], contentNormalFont));
      cautionTable.addCell(cautionCell);
    }
    float[] wf = {
        10,
        10
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPCell

  private void addGestionDto() throws DocumentException {
   
    PdfPTable headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);

    PdfPCell headerCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.gestion", null, localtion), contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerTable.addCell(headerCell);
    addContent(headerTable);
 
    //Add Group Header
    PdfPCell[] groupHeaderCell = new PdfPCell[6];
    groupHeaderCell[0] = new PdfPCell();
    groupHeaderCell[0].setBorder(Rectangle.NO_BORDER);
    groupHeaderCell[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.allfichest.traite", null, localtion), contentBoldFont));
    groupHeaderCell[1].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    groupHeaderCell[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.allfichest.atraite", null, localtion), contentBoldFont));
    groupHeaderCell[2].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    groupHeaderCell[3] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.allfichest.budgetconforme", null, localtion), contentBoldFont));
    groupHeaderCell[3].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    groupHeaderCell[4] = new PdfPCell();
    groupHeaderCell[4].setBorder(Rectangle.NO_BORDER);
    groupHeaderCell[5] = new PdfPCell();
    groupHeaderCell[5].setBorder(Rectangle.NO_BORDER);
   
    float[] wfGroupHeader = {
        41,
        18,
        10,
        22,
        17,
        7
      };
    for (PdfPCell pdfPCell : groupHeaderCell) {
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }

    PdfPTable groupHeaderTable = new PdfPTable(6);
    groupHeaderTable.setWidthPercentage(100f);
    groupHeaderTable.setWidths(wfGroupHeader);
    addCellsToTable(groupHeaderTable,groupHeaderCell);
    addContent(groupHeaderTable);
   
    //Content Header
    PdfPCell[] riskTableHeader = new PdfPCell[16];
    riskTableHeader[0] = new PdfPCell(new Phrase( messageSource.getMessage("FicheST.devis", null, localtion), contentBoldFont));
    riskTableHeader[1] = new PdfPCell(new Phrase( messageSource.getMessage("FicheST.status", null, localtion), contentBoldFont));
    riskTableHeader[2] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.libelle", null, localtion), contentBoldFont));
    riskTableHeader[3] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.commentaires", null, localtion), contentBoldFont));
    riskTableHeader[4] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.montant", null, localtion), contentBoldFont));
    riskTableHeader[5] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.marche_avenants", null, localtion), contentBoldFont));
    riskTableHeader[6] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.arrete", null, localtion), contentBoldFont));
    riskTableHeader[7] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.nonarrete", null, localtion), contentBoldFont));   
    riskTableHeader[8] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.provision", null, localtion), contentBoldFont));   
    riskTableHeader[9] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.devisrefuse", null, localtion), contentBoldFont));   
    riskTableHeader[10] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.totalfdc", null, localtion), contentBoldFont));   
    riskTableHeader[11] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.activitereel", null, localtion), contentBoldFont));   
    riskTableHeader[12] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.type", null, localtion), contentBoldFont));   
    riskTableHeader[13] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.libelle_", null, localtion), contentBoldFont));   
    riskTableHeader[14] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.montant", null, localtion), contentBoldFont));   
    riskTableHeader[15] = new PdfPCell(new Phrase( messageSource.getMessage("pdf.gestiondto.content.ecart", null, localtion), contentBoldFont));
    for (PdfPCell pdfPCell : riskTableHeader) {
      pdfPCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    //End
   
    PdfPTable gestionDtoTable = new PdfPTable(16);
    gestionDtoTable.setWidthPercentage(100f);
    addCellsToTable(gestionDtoTable, riskTableHeader);
    float[] wf = {
        7,  
        7
        7
        15
        5,
        18,
        5,
        5,
        5,
        5,
        7,
        5,
        5,
        7,
        5,
        7
      };
   
    gestionDtoTable.setWidthPercentage(100f);
    gestionDtoTable.setWidths(wf);
   
    //Add Header
    addContent(gestionDtoTable);

    gestionDtoTable.getDefaultCell().setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
   
    String tmp;
    for (int j = 0 ; j < gestions.size();j++) {
      gestionDtoTable = new PdfPTable(16);
      String param = gestions.get(j);
      if(param != null && param.length() > 0){
        String arr[] = param.split(Constants.SEPRATE);
        PdfPCell pdfPCell = null;
        for(int i=0;i < arr.length;i++){
          tmp = arr[i] ;//== null ? "" : arr[i];
          pdfPCell = new PdfPCell(new Phrase(tmp.equals("null") ? "" : tmp, contentNormalFont));
          pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
          gestionDtoTable.addCell(pdfPCell);
        }
      }
      gestionDtoTable.setWidthPercentage(100f);
      gestionDtoTable.setWidths(wf);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPCell

    }
  }
 
  private PdfPTable addtotalSum(String totalgestions) throws DocumentException {
    PdfPTable gestionDtoTable = new PdfPTable(11);
    PdfPCell gestionDtoCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.soustotaldumarche", null, localtion), contentBoldFont));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_LEFT);
    gestionDtoTable.addCell(gestionDtoCell);
    if(totalgestions != null && totalgestions.length() > 0){
      String[] tmp = totalgestions.split(Constants.SEPRATE);
      gestionDtoCell = new PdfPCell(new Phrase(tmp[0] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[1] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[2] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[3] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[4] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[5] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[6] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[7] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[8] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
     
      gestionDtoCell = new PdfPCell(new Phrase(tmp[9] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
      gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
      gestionDtoTable.addCell(gestionDtoCell);
 
      float[] wf = {
          36,   //CR 3
          5// Niveau de risque 5
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPCell

  }
 
  private PdfPTable addalltotalSum(String alltotalgestions) throws DocumentException {
    PdfPTable gestionDtoTable = new PdfPTable(11);
   
    PdfPCell gestionDtoCell = new PdfPCell(new Phrase("Montant REX ", contentBoldFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_CENTER);
    gestionDtoTable.addCell(gestionDtoCell);
   
    String[] tmp = alltotalgestions.split(Constants.SEPRATE);
   

    gestionDtoCell = new PdfPCell(new Phrase(tmp[0] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[1] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[2] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[3] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[4] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[5] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[6] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[7] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[8] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(new Phrase(tmp[9] + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion), contentNormalFont));
    gestionDtoCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    gestionDtoCell.setHorizontalAlignment(Rectangle.ALIGN_RIGHT);
    gestionDtoTable.addCell(gestionDtoCell);
   

    float[] wf = {
        36,   //CR 3
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPCell

  private PdfPTable addSummary(String sumarry){
   
    PdfPTable sumaryTable = new PdfPTable(2);
    String[] tmp = sumarry.split(Constants.SEPRATE);
   
    sumaryTable.addCell(new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.summary.objectif",null,localtion), contentBoldFont)));
    sumaryTable.addCell(new PdfPCell(new Phrase(tmp[0] + messageSource.getMessage("pdf.gestiondto.content.euro",null,localtion), contentNormalFont)));
   
   
    sumaryTable.addCell(new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.summary.transferts",null,localtion), contentBoldFont)));
    sumaryTable.addCell(new PdfPCell(new Phrase(tmp[1] + messageSource.getMessage("pdf.gestiondto.content.euro",null,localtion), contentNormalFont)));
   
    sumaryTable.addCell(new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.summary.rexettediverses",null,localtion), contentBoldFont)));
    sumaryTable.addCell(new PdfPCell(new Phrase(tmp[2] + messageSource.getMessage("pdf.gestiondto.content.euro",null,localtion), contentNormalFont)));
   
    sumaryTable.addCell(new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.summary.trxsupp",null,localtion), contentBoldFont)));
    sumaryTable.addCell(new PdfPCell(new Phrase(tmp[3] + messageSource.getMessage("pdf.gestiondto.content.euro",null,localtion), contentNormalFont)));

   
    PdfPTable gestionDtoTable = new PdfPTable(3);
    PdfPCell gestionDtoCell;
 
    gestionDtoCell = new PdfPCell();
    gestionDtoCell.setBorder(Rectangle.NO_BORDER);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(sumaryTable);
    gestionDtoCell.setBorder(Rectangle.NO_BORDER);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell();
    gestionDtoCell.setBorder(Rectangle.NO_BORDER);
    gestionDtoTable.addCell(gestionDtoCell);
 
    float[] wf = {
        91,
        17,
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPCell

    return gestionDtoTable;
  }
 
  private PdfPTable addBudget(String budget){
    PdfPTable budgetTable = new PdfPTable(2);
    PdfPCell budgetCell;
    String[] tmp = budget.split(Constants.SEPRATE);
    float[] wf = {
        12,   //CR 3
        17// Niveau de risque 5
      };
    try {
      budgetTable.setWidths(wf);
    } catch (DocumentException e) {
      e.printStackTrace();
    }
 
    budgetCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.content.budgetinitial",null,localtion), contentNormalFont));
    budgetCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    budgetTable.addCell(budgetCell);
    budgetTable.addCell(new PdfPCell(new Phrase(tmp[0].equals("null") ? "" : tmp[0] , contentNormalFont)));
   
    budgetCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.content.ecartdernierpoint",null,localtion), contentNormalFont));
    budgetCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    budgetTable.addCell(budgetCell);
    budgetTable.addCell(new PdfPCell(new Phrase(tmp[1].equals("null") ? "" : tmp[1], contentNormalFont)));
   
    budgetCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.gestiondto.content.datedernier",null,localtion), contentNormalFont));
    budgetCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    budgetTable.addCell(budgetCell);
    budgetTable.addCell(new PdfPCell(new Phrase(tmp[2].equals("null") ? "" : tmp[2], contentNormalFont)));
    budgetTable.setWidthPercentage(50f);
   
   
    PdfPTable gestionDtoTable = new PdfPTable(3);
    PdfPCell gestionDtoCell;
 
    gestionDtoCell = new PdfPCell();
    gestionDtoCell.setBorder(Rectangle.NO_BORDER);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell(budgetTable);
    gestionDtoCell.setBorder(Rectangle.NO_BORDER);
    gestionDtoTable.addCell(gestionDtoCell);
   
    gestionDtoCell = new PdfPCell();
    gestionDtoCell.setBorder(Rectangle.NO_BORDER);
    gestionDtoTable.addCell(gestionDtoCell);
 
    float[] wf1 = {
        79,
        29,
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPCell

  //Add Process Report
  private void addProcessDto() throws DocumentException {   

    PdfPTable headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
    PdfPCell headerCell = new PdfPCell(new Phrase("SUVI DES AVANCEMENTS", 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("Etat d’avancement: ", contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerTable.addCell(headerCell);
   
    headerCell = new PdfPCell(new Phrase(etatAvancement + " % AVANCEMENT / MARCHE", 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("ADVANCEMENT", contentBoldFont));
    groupHeaderCell[1].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));

    groupHeaderCell[2] = new PdfPCell(new Phrase("RETENUES", contentBoldFont));
    groupHeaderCell[2].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    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("Commentaires / Informations : ", 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(Constants.RED,Constants.GREEN,Constants.BLUE));
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    //End
    PdfPTable processDtoTable = new PdfPTable(7);
    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(7);
    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("DETAIL DES RETENUES APPLIQUES",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
   
    //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

Examples of com.lowagie.text.pdf.PdfPCell

  private void addDeductionDto() throws DocumentException {
    //Title
    PdfPTable headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
   
    PdfPCell headerCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.suivideavancementsdusoustraitant",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("INFORMATIONS GENERALS", 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("SUVI DES ACOMPTES", contentBoldFont));
    headerCell.setBorder(Rectangle.NO_BORDER);
    headerTable.addCell(headerCell);
    headerTable.setSpacingAfter(0f);
    addContent(headerTable);
   
    PdfPTable informationTable = addInformationTable();
    addContent(informationTable);
    lineBreak();
   
    //Add deduction
    PdfPTable deductionTable = addDeductionTable();
    addContent(deductionTable);
    //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,
        5,
        25
      };
    parent.setWidths(wfParent);
    //Add Penalties
    leftCell = new PdfPCell(new Phrase("PENALTIES",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("Commentaires",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

Examples of com.lowagie.text.pdf.PdfPCell

   * @throws DocumentException
   */
  private PdfPTable addInformationTable() throws DocumentException {
   
    PdfPTable informationTable = new PdfPTable(6);
    PdfPCell informationCell = new PdfPCell();
   
    //Add Content
    String[] tmp = information.split(Constants.SEPRATE);
    String [] messages = {messageSource.getMessage("FicheST.chantier", null,localtion) + " : ",
        messageSource.getMessage("FicheST.Responsable", null, localtion) + " : ",messageSource.getMessage("pdf.synthese.societe", null, localtion) + " : "};
    for(int i=0;i<tmp.length;i++){
      switch (i) {
      case 0:
        informationCell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
        informationCell.setBorder(Rectangle.NO_BORDER);
        informationTable.addCell(informationCell);
        break;
      case 1:
        informationCell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
        informationCell.setBorder(Rectangle.NO_BORDER);
        informationTable.addCell(informationCell);
        break;
      case 2:
        informationCell = new PdfPCell(new Phrase(messages[2], contentBoldFont));
        informationCell.setBorder(Rectangle.NO_BORDER);
        informationTable.addCell(informationCell);
        break;
      }
      informationCell = new PdfPCell(new Phrase(tmp[i], contentNormalFont));
      informationCell.setBorder(Rectangle.NO_BORDER);
      informationTable.addCell(informationCell);
    }
    float[] wf = {
        3,
        10,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.