Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfPCell


   
  }
 
  private PdfPTable addtotalsituation(String totalsituation) throws DocumentException{
    PdfPTable processDtoTable = new PdfPTable(5);
    processDtoTable.addCell(new PdfPCell(new Phrase("TOTAL SITUATION", contentBoldFont)));
   
    String[] tmp = totalsituation.split(Constants.SEPRATE);
    if(tmp != null && tmp.length > 3){
      processDtoTable.addCell(new PdfPCell(new Phrase(tmp[0], contentNormalFont)));
      processDtoTable.addCell(new PdfPCell(new Phrase(tmp[1] != null ? tmp[1] : "", contentNormalFont)));
      processDtoTable.addCell(new PdfPCell(new Phrase(tmp[2] != null ? tmp[2] : "", contentNormalFont)));
      processDtoTable.addCell(new PdfPCell(new Phrase(tmp[3] != null ? tmp[3] : "", contentNormalFont)));
    }else{
      processDtoTable.addCell(new PdfPCell(new Phrase("", contentNormalFont)));
      processDtoTable.addCell(new PdfPCell(new Phrase("", contentNormalFont)));
      processDtoTable.addCell(new PdfPCell(new Phrase("", contentNormalFont)));
      processDtoTable.addCell(new PdfPCell(new Phrase("", contentNormalFont)));
    }
    float[] wf = {
        25,
        10,
        10,
View Full Code Here


   */
  private PdfPTable addGrid2(String grid2){
    //create table header
    PdfPCell[] grid2TableHeader = new PdfPCell[3];
   
    grid2TableHeader[0] = new PdfPCell(new Phrase("", contentBoldFont));

    grid2TableHeader[1] = new PdfPCell(new Phrase("Montant", contentBoldFont));
    grid2TableHeader[1].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));

    grid2TableHeader[2] = new PdfPCell(new Phrase("Pourcentage du régularisé", contentBoldFont));
    grid2TableHeader[2].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    for (PdfPCell pdfPCell : grid2TableHeader) {
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
   
    PdfPTable grid2Table = new PdfPTable(3);
    PdfPCell grid2Cell;
   
    addCellsToTable(grid2Table, grid2TableHeader);
    String[] tmp = grid2.split(Constants.SEPRATE);
    String[] messages = {"Refacturations" ,"Prorata" ,"Refacturations dont prorata","Refacturations dont prorata et autre", "Pénalités"};
    for(int i=0; i < tmp.length ; i++){
      switch (i) {
      case 0:
        grid2Cell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
        grid2Cell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
        grid2Table.addCell(grid2Cell);
        break;
      case 2:
        grid2Cell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
        grid2Cell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
        grid2Table.addCell(grid2Cell);
        break;
      case 4:
        grid2Cell = new PdfPCell(new Phrase(messages[2], contentBoldFont));
        grid2Cell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
        grid2Table.addCell(grid2Cell);
        break;
      case 6:
        grid2Cell = new PdfPCell(new Phrase(messages[3], contentBoldFont));
        grid2Cell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
        grid2Table.addCell(grid2Cell);
        break;
      case 8:
        grid2Cell = new PdfPCell(new Phrase(messages[4], contentBoldFont));
        grid2Cell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
        grid2Table.addCell(grid2Cell);
        break;
      }
      grid2Table.addCell(new PdfPCell(new Phrase(tmp[i], contentBoldFont)));
   
    float[] wf = {
        25,
        10,
        20
View Full Code Here

 
  private PdfPTable addGrid3(String grid3){
    //create table header
    PdfPCell[] grid3TableHeader = new PdfPCell[8];
      
    grid3TableHeader[0] = new PdfPCell(new Phrase("", contentBoldFont));
   
    grid3TableHeader[1] = new PdfPCell(new Phrase("Canto", contentBoldFont));
    grid3TableHeader[1].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    grid3TableHeader[2] = new PdfPCell(new Phrase("Badge", contentBoldFont));
    grid3TableHeader[2].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));

    grid3TableHeader[3] = new PdfPCell(new Phrase("Grue", contentBoldFont));
    grid3TableHeader[3].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    grid3TableHeader[4] = new PdfPCell(new Phrase("Lift", contentBoldFont));
    grid3TableHeader[4].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    grid3TableHeader[5] = new PdfPCell(new Phrase("Benne", contentBoldFont));
    grid3TableHeader[5].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    grid3TableHeader[6] = new PdfPCell(new Phrase("Nettoyage", contentBoldFont));
    grid3TableHeader[6].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
    grid3TableHeader[7] = new PdfPCell(new Phrase("Autres", contentBoldFont));
    grid3TableHeader[7].setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
   
   
    for (PdfPCell pdfPCell : grid3TableHeader) {
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
   
    PdfPTable grid3Table = new PdfPTable(8);
    PdfPCell grid3Cell;
   
    addCellsToTable(grid3Table, grid3TableHeader);
     
    String[] tmp = grid3.split(Constants.SEPRATE);
   
    String[] messages = {"Nombre","Montant"};
    for(int i=0; i < tmp.length ; i++){
      switch (i) {
      case 0:
        grid3Cell = new PdfPCell(new Phrase(messages[0], contentBoldFont));
        grid3Cell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
        grid3Table.addCell(grid3Cell);
        break;
      case 7:
        grid3Cell = new PdfPCell(new Phrase(messages[1], contentBoldFont));
        grid3Cell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
        grid3Table.addCell(grid3Cell);
        break;
      }
      grid3Table.addCell(new PdfPCell(new Phrase(tmp[i], contentNormalFont)));
   
    float[] wf = {
        15,
        10,
        10,
View Full Code Here

 
  private PdfPTable addProcessCommantaire(String commantaire){
    //create table header
    PdfPTable commantaireTable = new PdfPTable(1);
   
    PdfPCell pdfPCell = new PdfPCell(new Phrase(commantaire, contentNormalFont));
    pdfPCell.setBorder(Rectangle.NO_BORDER);
    commantaireTable.addCell(pdfPCell)
    float[] wf = {
        15
      };
    try {
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("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

  }
 
  private PdfPTable addInformationTable() throws DocumentException {
   
    PdfPTable informationTable = new PdfPTable(6);
    PdfPCell informationCell = new PdfPCell();
   
    //Add Content
    String[] tmp = information.split(Constants.SEPRATE);
    String [] messages = {"Chantier : ","Responsable do lot : ","Société : "};
    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//Libellé risque codification
        10,   //Origine de détection
View Full Code Here

  }
 
  private PdfPTable addDeductionTable() throws DocumentException {
    //Title
    PdfPCell[] groupTitleCell = new PdfPCell[1];
    groupTitleCell[0] = new PdfPCell(new Phrase("RETENUES EFFECTUEES SUR BON D'ACOMPTE",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);
   
    String[] arrPrestations = prestations.split(Constants.SEPRATE);
    //create table header
    PdfPCell[] deductionTableHeader = new PdfPCell[10];
    deductionTableHeader[0] = new PdfPCell(new Phrase(messageSource.getMessage("FicheST.date",null,localtion), contentBoldFont));
    deductionTableHeader[1] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.canto",null,localtion) + arrPrestations[0], contentBoldFont));
    deductionTableHeader[2] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.badge",null,localtion) + arrPrestations[1], contentBoldFont));
    deductionTableHeader[3] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.grue",null,localtion) + arrPrestations[2], contentBoldFont))
    deductionTableHeader[4] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.lift",null,localtion) + arrPrestations[3], contentBoldFont));   
    deductionTableHeader[5] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.bene",null,localtion) + arrPrestations[4], contentBoldFont))
    deductionTableHeader[6] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.nettoyage",null,localtion) + arrPrestations[5], contentBoldFont));
    deductionTableHeader[7] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.autres",null,localtion), contentBoldFont));
    deductionTableHeader[8] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.prorata",null,localtion) + arrPrestations[6], contentBoldFont));
    deductionTableHeader[9] = new PdfPCell(new Phrase(messageSource.getMessage("pdf.process.accomptes.refacturations",null,localtion), contentBoldFont));
   
    for (PdfPCell pdfPCell : deductionTableHeader) {
      pdfPCell.setBackgroundColor(new Color(Constants.RED,Constants.GREEN,Constants.BLUE));
      pdfPCell.setHorizontalAlignment(PdfPCell.ALIGN_CENTER);
    }
    PdfPTable deductionTable = new PdfPTable(10);
   
    //Add Header
    addCellsToTable(deductionTable, deductionTableHeader);
   
    //Add Content
    String[] tmp = deductions.split(Constants.SEPRATE);
    for(int i=0;i<tmp.length;i++){
      deductionTable.addCell(new PdfPCell(new Phrase(tmp[i], contentNormalFont)));
    }

    float[] wf = {
        10//Libellé risque codification
        10,   //Origine de détection
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("Total", contentBoldFont)));
      }
      totalDeduction.addCell(new PdfPCell(new Phrase(tmp[i], contentBoldFont)));
    }
    float[] wf = {
        10//Libellé risque codification
        10,   //Origine de détection
        10,   //CR 3
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("Total", 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

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.