Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfPTable


    addContent(sumGrid3Table)
  }
 
  private void addGrid4() throws DocumentException{
    //Title
    PdfPTable titleTable = new PdfPTable(1);
    titleTable.setWidthPercentage(100f);
    PdfPCell titleCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.totalchantier", null, localtion), contentBoldFont));
    titleCell.setBorder(Rectangle.NO_BORDER);
    titleCell.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    titleTable.addCell(titleCell);
    addContent(titleTable);
    float[] wf = {
        2.5f,
        2.5f
        2.5f
        2.5f,   
        2.5f
        2.5f
        2.5f
        2.5f,
        2.5f,
        2.5f,
        2.5f,
        2.5f,
        2.5f
        2.5f
        2.5f,   
        2.5f
        2.5f
        2.5f
        2.5f,
        2.5f,
        2.5f,
        2.5f,
        2.5f,
        2.5f
        2.5f
        2.5f,   
        2.5f
        2.5f
        2.5f
        2.5f,
        2.5f,
        2.5f,
        2.5f,
        2.5f,
        2.5f
        2.5f
        2.5f,   
        2.5f
        2.5f
        2.5f,
        2.5f
      };
   
    //Header
    PdfPCell[] headerCell = new PdfPCell[41];
    headerCell[0] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.lot", 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.societe", null, localtion), contentBoldFont));
    headerCell[3] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.obj", null, localtion), contentBoldFont));
    headerCell[4] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.+-", null, localtion), contentBoldFont));
    headerCell[5] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.rd", null, localtion), contentBoldFont));
    headerCell[6] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.ts", null, localtion), contentBoldFont));
    headerCell[7] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.total", null, localtion), contentBoldFont));
    headerCell[8] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.traite", null, localtion), contentBoldFont));
    headerCell[9] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.arrete", null, localtion), contentBoldFont));
    headerCell[10] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.atraiter", null, localtion), contentBoldFont));
    headerCell[11] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.provision", null, localtion), contentBoldFont));
    headerCell[12] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.totalfinal", null, localtion), contentBoldFont));   
    headerCell[13] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.devisrefuse", null, localtion), contentBoldFont));   
    headerCell[14] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.ecartm", null, localtion), contentBoldFont));
    headerCell[15] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.ecartm-1", null, localtion), contentBoldFont));
    headerCell[16] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.variation", null, localtion), contentBoldFont));
    headerCell[17] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.ecartdernierpoint", null, localtion), contentBoldFont));
    headerCell[18] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.ecartdernierpoint/m", null, localtion), contentBoldFont));   
    headerCell[19] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.%avctba", null, localtion), contentBoldFont));
    headerCell[20] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.montnatba", null, localtion), contentBoldFont));   
    headerCell[21] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.%avctreel", null, localtion), contentBoldFont));
    headerCell[22] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.montantreel", null, localtion), contentBoldFont));
    headerCell[23] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.canto", null, localtion), contentBoldFont));
    headerCell[24] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.badge", null, localtion), contentBoldFont));
    headerCell[25] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.grue", null, localtion), contentBoldFont));
    headerCell[26] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.lift", null, localtion), contentBoldFont));
    headerCell[27] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.benne", null, localtion), contentBoldFont));
    headerCell[28] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.nettoy", null, localtion), contentBoldFont));
    headerCell[29] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.autres", null, localtion), contentBoldFont));
    headerCell[30] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.prorata", null, localtion), contentBoldFont));
    headerCell[31] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.total", null, localtion), contentBoldFont));
    headerCell[32] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.prestation/traite", null, localtion), contentBoldFont));
    headerCell[33] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.penalitefacture", null, localtion), contentBoldFont));
    headerCell[34] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.prorataappliqusest", null, localtion), contentBoldFont));
    headerCell[35] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.proratamarche", null, localtion), contentBoldFont));
    headerCell[36] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.proratasurrad", null, localtion), contentBoldFont));
    headerCell[37] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.marchesrestantatraiter%", null, localtion), contentBoldFont));
    headerCell[38] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.marchesrestantatraiter", null, localtion), contentBoldFont));
    headerCell[39] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.variationsuauxtransferts", null, localtion), contentBoldFont));
    headerCell[40] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.manqueagagnerstsansprorata", null, localtion), contentBoldFont));
    for (PdfPCell pdfPCell : headerCell) {
      pdfPCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    PdfPTable headerTable = new PdfPTable(41);
    headerTable.setWidthPercentage(100f);
    headerTable.setWidths(wf);
    addCellsToTable(headerTable,headerCell);
    addContent(headerTable);
   
    //Content
    PdfPTable grid4Table = new PdfPTable(41);
    String[] arrGrid4 = grid4.split(Constants.SEPRATE);
    String tmp;
    for (int i=0;i<arrGrid4.length;i++) {
      tmp = arrGrid4[i];
      grid4Table.addCell(new PdfPCell(new Phrase((tmp.equals("null") ? "" : tmp), contentNormalFont)))
    }
    grid4Table.setWidthPercentage(100f);
    addContent(grid4Table)
   
  }
View Full Code Here


    addContent(grid4Table)
   
  }
  private void addSumGrid4() throws DocumentException {
    //Content
    PdfPTable sumGrid4Table = new PdfPTable(41);
    String[] arrSumGrid4 = sumGrid4.split(Constants.SEPRATE);
    String tmp;
    for (int i=0;i<arrSumGrid4.length;i++) {
      tmp = arrSumGrid4[i];
      sumGrid4Table.addCell(new PdfPCell(new Phrase(tmp.equals("null") ? "" : (tmp + messageSource.getMessage("pdf.gestiondto.content.euro", null, localtion)), contentNormalFont)))
    }
    sumGrid4Table.setWidthPercentage(100f);
    addContent(sumGrid4Table)
  }
View Full Code Here

   * @throws DocumentException
   */
  private void addInformationChantier() throws DocumentException {
   
    //Title
    PdfPTable titleTable = new PdfPTable(1);
    titleTable.setWidthPercentage(100f);
    PdfPCell titleCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.title", null, localtion), contentBoldFont));
    titleCell.setBorder(Rectangle.NO_BORDER);
    titleCell.setHorizontalAlignment(PdfPTable.ALIGN_CENTER);
    titleTable.addCell(titleCell);
    addContent(titleTable);
    PdfPTable informationChantierTable = new PdfPTable(1);
    informationChantierTable.setWidthPercentage(100f);
    PdfPCell informationChantierCell;
    informationChantierTable.setWidthPercentage(100f);
    informationChantierCell = new PdfPCell(new Phrase(messageSource.getMessage("pdf.synthese.nomduchantier", null, localtion) + Constants.SPACE + informationChantier, contentBoldFont));
    informationChantierCell.setColspan(1);
    informationChantierCell.setBorder(Rectangle.NO_BORDER);
    informationChantierTable.addCell(informationChantierCell);;
    addContent(informationChantierTable);
  }
View Full Code Here

   
  }
 
  private PdfPTable addConditions() throws DocumentException {
   
    PdfPTable conditionsTable = new PdfPTable(2);
    PdfPCell conditionsCell = new PdfPCell();
   
    //Add Content
    String[] tmp = conditionsparticulieres.split(Constants.SEPRATE);
    String [] messages = {messageSource.getMessage("pdf.allfichest.payment", null, localtion) + " : ",messageSource.getMessage("FicheST.rg", null, localtion) + " : ",
        messageSource.getMessage("pdf.allfichest.decenalenecessaire", null, localtion) + " : ",messageSource.getMessage("pdf.allfichest.demandedagrement", null, localtion) + " : ",
        messageSource.getMessage("pdf.allfichest.dgdpresente",null, localtion) + " : ",messageSource.getMessage("FicheST.date", null, localtion) + " : "};
    for(int i=0;i<tmp.length;i++){
      switch (i) {
      case 0:
        conditionsCell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
        conditionsCell.setBorder(Rectangle.NO_BORDER);
        conditionsTable.addCell(conditionsCell);
        break;
      case 1:
        conditionsCell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
        conditionsCell.setBorder(Rectangle.NO_BORDER);
        conditionsTable.addCell(conditionsCell);
        break;
      case 2:
        conditionsCell = new PdfPCell(new Phrase(messages[2], contentBoldFont));
        conditionsCell.setBorder(Rectangle.NO_BORDER);
        conditionsTable.addCell(conditionsCell);
        break;
      case 3:
        conditionsCell = new PdfPCell(new Phrase(messages[3], contentBoldFont));
        conditionsCell.setBorder(Rectangle.NO_BORDER);
        conditionsTable.addCell(conditionsCell);
        break;
      case 4:
        conditionsCell = new PdfPCell(new Phrase(messages[4], contentBoldFont));
        conditionsCell.setBorder(Rectangle.NO_BORDER);
        conditionsTable.addCell(conditionsCell);
        break;
      case 5:
        conditionsCell = new PdfPCell(new Phrase(messages[5], contentBoldFont));
        conditionsCell.setBorder(Rectangle.NO_BORDER);
        conditionsTable.addCell(conditionsCell);
        break;
      }
      conditionsCell = new PdfPCell(new Phrase(tmp[i].equals("null") ? "" : tmp[i] , contentNormalFont));
      conditionsCell.setBorder(Rectangle.NO_BORDER);
      conditionsTable.addCell(conditionsCell);
    }
    float[] wf = {
        10,
        10
      };
    conditionsTable.setWidthPercentage(30f);
    conditionsTable.setWidths(wf);
    return conditionsTable;
  }
View Full Code Here

    return conditionsTable;
  }
 
  private PdfPTable addPrestations() throws DocumentException {
   
    PdfPTable prestationsTable = new PdfPTable(2);
    PdfPCell prestationsCell = new PdfPCell();
   
    //Add Content
    String[] tmp = prestations.split(Constants.SEPRATE);
    String [] messages = {messageSource.getMessage("pdf.allfichest.prestations", null,localtion) + " : ",messageSource.getMessage("pdf.allfichest.assurances", null, localtion) + " : ",
        messageSource.getMessage("pdf.allfichest.prodata", null, localtion) + " : ",messageSource.getMessage("pdf.allfichest.canto",null, localtion) + " : ",
        messageSource.getMessage("pdf.allfichest.badge", null, localtion) + " : ",messageSource.getMessage("pdf.allfichest.grue", null, localtion) + " : ",
        messageSource.getMessage("pdf.allfichest.lift", null, localtion) + " : ",messageSource.getMessage("pdf.allfichest.benne", null, localtion) + " : ",
        messageSource.getMessage("pdf.allfichest.netoyage", null, localtion) + " : "};
    for(int i=0;i<tmp.length;i++){
      switch (i) {
      case 0:
        prestationsCell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.TOP);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
        prestationsTable.addCell(prestationsCell);
        break;
      case 1:
        prestationsCell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
        prestationsTable.addCell(prestationsCell);
        break;
      case 2:
        prestationsCell = new PdfPCell(new Phrase(messages[2], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
        prestationsTable.addCell(prestationsCell);
        break;
      case 3:
        prestationsCell = new PdfPCell(new Phrase(messages[3], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
        prestationsTable.addCell(prestationsCell);
        break;
      case 4:
        prestationsCell = new PdfPCell(new Phrase(messages[4], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
     
        prestationsTable.addCell(prestationsCell);
        break;
      case 5:
        prestationsCell = new PdfPCell(new Phrase(messages[5], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
        prestationsTable.addCell(prestationsCell);
        break;
      case 6:
        prestationsCell = new PdfPCell(new Phrase(messages[6], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
        prestationsTable.addCell(prestationsCell);
        break;
      case 7:
        prestationsCell = new PdfPCell(new Phrase(messages[7], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
        prestationsTable.addCell(prestationsCell);
        break;
      case 8:
        prestationsCell = new PdfPCell(new Phrase(messages[8], contentBoldFont));
        prestationsCell.setBorder(Rectangle.NO_BORDER);
        prestationsCell.enableBorderSide(Rectangle.LEFT);
        prestationsCell.enableBorderSide(Rectangle.BOTTOM);
        prestationsTable.addCell(prestationsCell);
        break;
      }
      prestationsCell = new PdfPCell(new Phrase(tmp[i].equals("null") ? "" : tmp[i], contentNormalFont));
      prestationsCell.setBorder(Rectangle.NO_BORDER);
      if(i == 0)
        prestationsCell.enableBorderSide(Rectangle.TOP);
      if(i == (tmp.length -1))
        prestationsCell.enableBorderSide(Rectangle.BOTTOM);
      prestationsCell.enableBorderSide(Rectangle.RIGHT);
      prestationsTable.addCell(prestationsCell);
    }
    float[] wf = {
        10,
        10
      };
    prestationsTable.setWidthPercentage(30f);
    prestationsTable.setWidths(wf);
    return prestationsTable;
  }
View Full Code Here

    return prestationsTable;
  }
 
  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,
        20,
        10
      };
    informationsTable.setWidthPercentage(30f);
    informationsTable.setWidths(wf);
    return informationsTable;
  }
View Full Code Here

    return informationsTable;
  }
 
  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
      };
    cautionTable.setWidthPercentage(30f);
    cautionTable.setWidths(wf);
    return cautionTable;
  }
View Full Code Here

    return grid3;
  }
 
  //Add Gestion Report
  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("TRAITE", contentBoldFont));
    groupHeaderCell[1].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));

    groupHeaderCell[2] = new PdfPCell(new Phrase("A TRAITER", contentBoldFont));
    groupHeaderCell[2].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
    groupHeaderCell[3] = new PdfPCell(new Phrase("BUDGET Conforme", 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);
        for(int i=0;i < arr.length;i++){
          tmp = arr[i] ;//== null ? "" : arr[i];
          gestionDtoTable.addCell(new PdfPCell(new Phrase(tmp.equals("null") ? "" : tmp, contentNormalFont)));
        }
      }
      gestionDtoTable.setWidthPercentage(100f);
      gestionDtoTable.setWidths(wf);
      gestionDtoTable.setSpacingAfter(3f);
      addContent(gestionDtoTable);
     
      PdfPTable totalSumTable = addtotalSum(totalgestions.get(j));
      totalSumTable.setWidthPercentage(100f);
      totalSumTable.setSpacingAfter(3f);
      addContent(totalSumTable);
       
    }
   
    PdfPTable alltotalSumTable = addalltotalSum(alltotalgestion);
    try {
      alltotalSumTable.setWidthPercentage(100f);
      alltotalSumTable.setSpacingAfter(3f);
      addContent(alltotalSumTable);
    } catch (DocumentException e) {
      e.printStackTrace();
    }
   
    PdfPTable sumarryTable = addSummary(summary);
    try {
      sumarryTable.setHorizontalAlignment(PdfPTable.ALIGN_RIGHT);
      sumarryTable.setSpacingAfter(3f);
      addContent(sumarryTable);
    } catch (DocumentException e) {
      e.printStackTrace();
    }
   
    PdfPTable budgetTable = addBudget(budget);
    try {
      budgetTable.setHorizontalAlignment(PdfPTable.ALIGN_RIGHT);
      addContent(budgetTable);
    } catch (DocumentException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      e.printStackTrace();
    }
  }
 
  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_CENTER);
    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
          18// Phase
          5,   //Statut
          5// Date de création
          5// Date de levée
          5// Responsable 
          7// Cout UO
          5// Cout ST
          17// Vu
          7
        };
      gestionDtoTable.setWidths(wf);
    }

    return gestionDtoTable;
  }
View Full Code Here

    return gestionDtoTable;
  }
 
  private PdfPTable addalltotalSum(String alltotalgestions) throws DocumentException {
    PdfPTable gestionDtoTable = new PdfPTable(11);
   
    PdfPCell gestionDtoCell = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.rexAmount",null,localtion), 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
        5,
        18,
        5,
        5,
        5,
        5,
        7,
        5,
        17,
        7
      };
    gestionDtoTable.setWidths(wf);
    return gestionDtoTable;
  }
View Full Code Here

TOP

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

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.