Examples of PdfPTable


Examples of com.lowagie.text.pdf.PdfPTable

  public void flush(){
    getMe();
  }

  public PdfPTable getMe() {
    PdfPTable tabla = new PdfPTable(columnas);
   
    Iterator it = celdas.iterator();
    while (it.hasNext()) {
      CeldaPDF celda = (CeldaPDF) it.next();
      tabla.addCell(celda.getMe());
    }
    try {
      if (tamanioColumnas!=null){
        float[] widths = new float[tamanioColumnas.size()];
        for (int i = 0; i < tamanioColumnas.size(); i++) {
            Float f = tamanioColumnas.get(i);
            widths[i] = (f != null ? f : Float.NaN); // Or whatever default you want.
        }
        tabla.setWidths(widths);
      }
      if (agregarADocumento.booleanValue()){
        documento.add(tabla);
      }
    } catch (DocumentException e) {
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

        // TODO Auto-generated catch block
        e.printStackTrace();
      }
        }
        // does it have table info?
        PdfPTable table = cell.getTable();
        if(table != null) {
          this.add(table);
//            try {
//        RtfBasicElement[] rtfElements = this.document.getMapper().mapElement(table);
//        for (int i = 0; i < rtfElements.length; i++) {
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

        document.open();
        if (rowList.size() > 0) {
          Paragraph p = new Paragraph(rowList.get(0).get(0).toString());

          document.add(p);
          PdfPTable table = new PdfPTable(9);
          table.setSpacingBefore(20);
          for (int i = 1; i < rowList.size(); i++) {

            List<HSSFCell> row = rowList.get(i);
            for (int j = 0; j < row.size(); j++) {
              HSSFCell myCell = row.get(j);
              // TODO aufhübschen und nicht toString() nutzen

              String stringCellValue = myCell.toString();
              table.addCell(stringCellValue);
            }

          }
          document.add(table);
        }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

            Image image = Image.getInstance( DroolsDocsBuilder.class.getResource( "drools-guvnor.png" ) );
            image.setAlignment( Image.RIGHT );
            image.scaleAbsolute( 100,
                                 30 );
            Rectangle page = document.getPageSize();
            PdfPTable head = new PdfPTable( 2 );

            PdfPCell cell1 = new PdfPCell( image );
            cell1.setHorizontalAlignment( Element.ALIGN_LEFT );
            cell1.setBorder( 0 );

            head.addCell( cell1 );

            PdfPCell cell2 = new PdfPCell( new Phrase( currentDate,
                                                       DroolsDocsComponentFactory.HEADER_FOOTER_TEXT ) );
            cell2.setHorizontalAlignment( Element.ALIGN_RIGHT );
            cell2.setBorder( 0 );

            head.addCell( cell2 );

            head.setTotalWidth( page.getWidth() - document.leftMargin() - document.rightMargin() );
            head.writeSelectedRows( 0,
                                    -1,
                                    document.leftMargin(),
                                    page.getHeight() - document.topMargin() + head.getTotalHeight(),
                                    writer.getDirectContent() );

        } catch ( Exception e ) {
            throw new ExceptionConverter( e );
        }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

            doc.add(pData);
            doc.add(Chunk.NEWLINE);

            // Generates the data table
            int rowNo = 5;
            PdfPTable dataTableHeader = new PdfPTable(rowNo);
            PdfPCell dataTblHeaderCell;

            Phrase pTemp = new Phrase("NODE", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);
            pTemp = new Phrase("DEPTH"+"\n"+"(m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);
            pTemp = new Phrase("MODULUS OF SUBGRADE REACTION"+"\n"+"(kN/m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);
            pTemp = new Phrase("LATERAL SOIL MOVEMENTS"+"\n"+"(m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);
            pTemp = new Phrase("LIMIT SOIL PRESSURE"+"\n"+"(kN/m²)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            dataTblHeaderCell = new PdfPCell(pTemp);
            dataTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            dataTableHeader.addCell(dataTblHeaderCell);

            PdfPCell dataTblCell;
           
            PdfPTable dataTable = new PdfPTable(rowNo);
            for (int i = 0; i <= data.getNumOfElements(); i++) {

                Phrase pNode = new Phrase(Integer.toString(i), FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
                dataTblCell = new PdfPCell(pNode);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
                Phrase pPileNodeCoord = new Phrase(Double.toString(data.getPileNodeCoordinate(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                dataTblCell = new PdfPCell(pPileNodeCoord);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
                Phrase pModOfSub = new Phrase(Double.toString(data.getModOfSubgradeReaction(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                dataTblCell = new PdfPCell(pModOfSub);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
                Phrase pLateralSoilMov = new Phrase(Double.toString(data.getLateralSoilMovement(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                dataTblCell = new PdfPCell(pLateralSoilMov);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
                Phrase pLimitSoilPress = new Phrase(Double.toString(data.getLimitSoilPressure(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                dataTblCell = new PdfPCell(pLimitSoilPress);
                dataTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                dataTable.addCell(dataTblCell);
              
            }
            doc.add(dataTableHeader);
            doc.add(dataTable);
            doc.newPage();

            // Create the title for the result table
            Chunk theResultTable = new Chunk("The Result Table", new Font(Font.TIMES_ROMAN, 18, Font.BOLD));
            Paragraph pResult = new Paragraph(theResultTable);
            pResult.setAlignment(Element.ALIGN_CENTER);
            doc.add(pResult);
            doc.add(Chunk.NEWLINE);

            // Generates the result table
            rowNo = 9;
            PdfPTable resultTableHeader = new PdfPTable(rowNo);
            PdfPCell resultTblHeaderCell;

            pTemp = new Phrase("NODE", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("DEPTH"+"\n"+"(m)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("SOIL MOVEMENT"+"\n"+"(mm)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("SOIL PRESSURE"+"\n"+"(kPa)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("ABS"+"\n"+"SOIL PRESSURE"+"\n"+"(kPa)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("DISPLACEMENT"+"\n"+"(mm)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("ROTATION"+"\n"+"(rad)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 7, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("BENDING MOMENT"+"\n"+"(kNm)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);
            pTemp = new Phrase("SHEAR FORCE"+"\n"+"(kN)", FontFactory.getFont(FontFactory.TIMES_ROMAN, 8, Font.BOLD));
            resultTblHeaderCell = new PdfPCell(pTemp);
            resultTblHeaderCell.setHorizontalAlignment(Element.ALIGN_CENTER);
            resultTableHeader.addCell(resultTblHeaderCell);

            PdfPTable resultTable = new PdfPTable(rowNo);
            PdfPCell resultTblCell;
           
            for (int i = 0; i < data.getNumOfElements() + 1; i++) {
               
                Phrase pNodes = new Phrase(Integer.toString(i), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.BOLD));
                resultTblCell = new PdfPCell(pNodes);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pPileNodeCoord = new Phrase(Double.toString(data.getPileNodeCoordinate(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pPileNodeCoord);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pSoilMov = new Phrase(Double.toString(result.getSoilMovement(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pSoilMov);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pSoilPress = new Phrase(Double.toString(result.getSoilPressure(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pSoilPress);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pLimitPressure = new Phrase(Double.toString(result.getLimitPressure(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pLimitPressure);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pDisplacement = new Phrase(Double.toString(result.getDisplacement(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pDisplacement);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pRotation = new Phrase(Double.toString(result.getRotation(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pRotation);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pBendingMoment = new Phrase(Double.toString(result.getBendingMoment(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pBendingMoment);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
                Phrase pShearForce = new Phrase(Double.toString(result.getShearForce(i)), FontFactory.getFont(FontFactory.TIMES_ROMAN, 9, Font.NORMAL));
                resultTblCell = new PdfPCell(pShearForce);
                resultTblCell.setHorizontalAlignment(Element.ALIGN_CENTER);
                resultTable.addCell(resultTblCell);
               
            }
            doc.add(resultTableHeader);
            doc.add(resultTable);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

    }
    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,
        7
      };
    try {
      gestionDtoTable.setWidthPercentage(100f);
      gestionDtoTable.setWidths(wf1);
    } catch (DocumentException e) {
      e.printStackTrace();
    }
    return gestionDtoTable;
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

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

    PdfPTable headerTable = new PdfPTable(1);
    headerTable.setWidthPercentage(100f);
    PdfPCell 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 + " " + 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("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, 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);
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

    addContent(parent);
   
  }
 
  private PdfPTable addtotalsituation(String totalsituation) throws DocumentException{
    PdfPTable processDtoTable = new PdfPTable(5);
    processDtoTable.addCell(new PdfPCell(new Phrase(messageSource.getMessage("FicheST.totalSituation", null, localtion), contentBoldFont)));
    boolean isEmpty = true;
    if(totalsituation != null && totalsituation.length() > 0){
      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)));
      }
    }
    if(isEmpty){
      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,
        10,
        10
      };
    processDtoTable.setWidths(wf);
    return processDtoTable;
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

   
    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 = {messageSource.getMessage("pdf.process.accomptes.refacturations", null, localtion),
        messageSource.getMessage("pdf.synthese.prorata", null, localtion),
        messageSource.getMessage("FicheST.RefacturationsDontProrata", null, localtion),
        messageSource.getMessage("FicheST.RefacturationsDontProrataEtAutre", null,localtion),
        messageSource.getMessage("pdf.process.titlebox.penalites", null, localtion)};
    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
      };
    try {
      grid2Table.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
      grid2Table.setWidths(wf);
    } catch (DocumentException e) {
      e.printStackTrace();
    }
    return grid2Table;
  }
View Full Code Here

Examples of com.lowagie.text.pdf.PdfPTable

   
    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 = {messageSource.getMessage("FicheST.nombre", null, localtion),messageSource.getMessage("FicheST.amount2", null, localtion)};
    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,
        10,
        10,
        10,10,
        10
      };
    try {
      grid3Table.setWidths(wf);
      grid3Table.setHorizontalAlignment(PdfPTable.ALIGN_LEFT);
    } catch (DocumentException e) {
      e.printStackTrace();
    }
    return grid3Table;
  }
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.