Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfPCell


     * @param  tag    a cell tag
     * @param  chain  the hierarchy chain
     * @return the created PdfPCell
     */
  public PdfPCell createPdfPCell(final String tag, final ChainedProperties chain) {
    PdfPCell cell = new PdfPCell((Phrase)null);
        // colspan
    String value = chain.getProperty(HtmlTags.COLSPAN);
        if (value != null)
            cell.setColspan(Integer.parseInt(value));
        // rowspan
        value = chain.getProperty(HtmlTags.ROWSPAN);
        if (value != null)
            cell.setRowspan(Integer.parseInt(value));
        // horizontal alignment
        if (tag.equals(HtmlTags.TH))
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
        value = chain.getProperty(HtmlTags.ALIGN);
        if (value != null) {
            cell.setHorizontalAlignment(HtmlUtilities.alignmentValue(value));
        }
        // vertical alignment
        value = chain.getProperty(HtmlTags.VALIGN);
        cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
        if (value != null) {
            cell.setVerticalAlignment(HtmlUtilities.alignmentValue(value));
        }
        // border
        value = chain.getProperty(HtmlTags.BORDER);
        float border = 0;
        if (value != null)
            border = Float.parseFloat(value);
        cell.setBorderWidth(border);
        // cellpadding
        value = chain.getProperty(HtmlTags.CELLPADDING);
        if (value != null)
            cell.setPadding(Float.parseFloat(value));
        cell.setUseDescender(true);
        // background color
        value = chain.getProperty(HtmlTags.BGCOLOR);
        cell.setBackgroundColor(HtmlUtilities.decodeColor(value));
        return cell;
  }
View Full Code Here


     
      float[] relSizeMain = {1,1,1,1,1};
      PdfPTable tableMain = new PdfPTable(relSizeMain);
      tableMain.getDefaultCell().setBorder(Rectangle.BOX);
     
      PdfPCell cH1 = new PdfPCell(new Phrase("Krankenkasse", mainBigFont));
      cH1.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMain.addCell(cH1);
     
      PdfPCell cH2 = new PdfPCell(new Phrase("Bundesland", mainBigFont));
      cH2.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMain.addCell(cH2);
     
      PdfPCell cH3 = new PdfPCell(new Phrase("Religion", mainBigFont));
      cH3.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMain.addCell(cH3);

      PdfPCell cH4 = new PdfPCell(new Phrase("Geb. Datum", mainBigFont));
      cH4.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMain.addCell(cH4);
     
      PdfPCell cH5 = new PdfPCell(new Phrase("Kinder", mainBigFont));
      cH5.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMain.addCell(cH5);
     
      tableMain.setHeaderRows(1);
     
      tableMain.addCell(krankenkasse);
      tableMain.addCell(bundesland);
      tableMain.addCell(religion);
      tableMain.addCell(abrechnDate.format(gebDate));
      tableMain.addCell(""+kinder);
     
      float[] relSizeMainGehalt = {12,3,8,8};
      PdfPTable tableMainGehalt = new PdfPTable(relSizeMainGehalt);
      tableMainGehalt.getDefaultCell().setBorder(Rectangle.BOX);
     
      PdfPCell cA1 = new PdfPCell(new Phrase("Ab-/Bez�ge", mainBigFont));
      cA1.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMainGehalt.addCell(cA1);
     
      PdfPCell cA2 = new PdfPCell(new Phrase("%", mainBigFont));
      cA2.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMainGehalt.addCell(cA2);
     
      PdfPCell cA3 = new PdfPCell(new Phrase("Teilbetr�ge", mainBigFont));
      cA3.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMainGehalt.addCell(cA3);
     
      PdfPCell cA4 = new PdfPCell(new Phrase("Gesamtbetrag", mainBigFont));
      cA4.setHorizontalAlignment(Element.ALIGN_CENTER);
      tableMainGehalt.addCell(cA4);
     
      tableMainGehalt.setHeaderRows(1);
     
      tableMainGehalt.addCell("Bruttogehalt");
      tableMainGehalt.addCell("");
      PdfPCell c = new PdfPCell(new Phrase(df.format(bruttogehalt)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
   
      tableMainGehalt.addCell("+ Sonstige Bez�ge");
      tableMainGehalt.addCell("");
      c = new PdfPCell(new Phrase(df.format(sonstBezug)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
     
      tableMainGehalt.addCell("- Sonstige Abz�ge");
      tableMainGehalt.addCell("");
      c = new PdfPCell(new Phrase(df.format(sonstAbzug)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
     
     
      PdfPCell c6 = new PdfPCell(new Phrase("= Zu versteuerndes Einkommen"));
      c6.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c6);
     
      PdfPCell c7 = new PdfPCell(new Phrase(""));
      c7.setBorderWidthRight(0);
      c7.setBorderWidthLeft(0);
      c7.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c7);
     
      PdfPCell c8 = new PdfPCell(new Phrase(""));
      c8.setBorderWidthRight(0);
      c8.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c8);
     
      PdfPCell c9 = new PdfPCell(new Phrase(df.format(zuVersteuerndesEinkommen)));
      c9.setBorderWidthBottom(1);
      c9.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c9);
     
      tableMainGehalt.addCell("- Lohnsteuer");
      tableMainGehalt.addCell("");
      c = new PdfPCell(new Phrase(df.format(lohnsteuer)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
     
      tableMainGehalt.addCell("- Kirchensteuer");
      c = new PdfPCell(new Phrase(pf.format(prozentKirchensteuer)+" %"));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      c = new PdfPCell(new Phrase(df.format(kirchensteuer)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
     
      tableMainGehalt.addCell("- Solidarit�tszuschlag");
      tableMainGehalt.addCell("");
      c = new PdfPCell(new Phrase(df.format(soli)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
           
      PdfPCell c10 = new PdfPCell(new Phrase("= Zu Gesamte Steuerabz�ge"));
      c10.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c10);
     
      PdfPCell c11 = new PdfPCell(new Phrase(""));
      c11.setBorderWidthRight(0);
      c11.setBorderWidthLeft(0);
      c11.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c11);
     
      PdfPCell c12 = new PdfPCell(new Phrase(""));
      c12.setBorderWidthRight(0);
      c12.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c12);
     
      PdfPCell c13 = new PdfPCell(new Phrase(df.format(gesSteuerabzug)));
      c13.setBorderWidthBottom(1);
      c13.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c13);
     
     
      tableMainGehalt.addCell("- Krankenversicherung");
      c = new PdfPCell(new Phrase(pf.format(prozentKrankenversicherung)+" %"));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      c = new PdfPCell(new Phrase(df.format(krankenversicherung)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
     
      tableMainGehalt.addCell("- Pflegeversicherung");
      c = new PdfPCell(new Phrase(pf.format(prozentPflegeversicherung)+" %"));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      c = new PdfPCell(new Phrase(df.format(pflegeversicherung)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
     
      tableMainGehalt.addCell("- Rentenversicherung");
      c = new PdfPCell(new Phrase(pf.format(prozentRentenversicherung)+" %"));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      c = new PdfPCell(new Phrase(df.format(rentenversicherung)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
     
      tableMainGehalt.addCell("- Arbeitslosenversicherung");
      c = new PdfPCell(new Phrase(pf.format(prozentArbeitslosenversicherung)+" %"));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      c = new PdfPCell(new Phrase(df.format(arbeitslosenversicherung)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
      tableMainGehalt.addCell("");
           
      PdfPCell c14 = new PdfPCell(new Phrase("= Gesamte Sozialver. Abz�ge"));
      c14.setBorderWidthTop(0);
      c14.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c14);
     
      PdfPCell c15 = new PdfPCell(new Phrase(""));
      c15.setBorderWidthTop(0);
      c15.setBorderWidthRight(0);
      c15.setBorderWidthLeft(0);
      c15.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c15);
     
      PdfPCell c16 = new PdfPCell(new Phrase(""));
      c16.setBorderWidthTop(0);
      c16.setBorderWidthRight(0);
      c16.setBorderWidthBottom(1);
      tableMainGehalt.addCell(c16);
     
      PdfPCell c17 = new PdfPCell(new Phrase(df.format(gesSozialversicherungsabzug)));
      c17.setBorderWidthTop(0);
      c17.setBorderWidthBottom(1);
      c17.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c17);
     
      tableMainGehalt.addCell("= Nettogehalt");
      tableMainGehalt.addCell("");
      tableMainGehalt.addCell("");
      c = new PdfPCell(new Phrase(df.format(nettogehalt)));
      c.setHorizontalAlignment(Element.ALIGN_RIGHT);
      tableMainGehalt.addCell(c);
     
     
      PdfPCell c18 = new PdfPCell(new Phrase(""));
      c18.setColspan(4);
      c18.setBorderWidth(1);
      c18.setBorderWidthLeft(0);
      c18.setBorderWidthRight(0);
      tableMainGehalt.addCell(c18);
     
     
      PdfPCell c19 = new PdfPCell(new Phrase(""));
      c19.setColspan(4);
      c19.setBorderWidth(0);
      tableMainGehalt.addCell(c19);
     
      float[] relSizeBorder = {1};
      PdfPTable tableBorder = new PdfPTable(relSizeBorder);
      tableBorder.getDefaultCell().setBorderWidth(1);
      tableBorder.setWidthPercentage(100);
      tableBorder.addCell(tableMain);
      tableBorder.addCell(tableMainGehalt);
     
      main.add(tableBorder);
      //ende main
      PdfPTable header1 = new PdfPTable(1);
      PdfPCell cell = new PdfPCell(new Phrase(" ", FontFactory.getFont(FontFactory.HELVETICA, 54)));
      cell.setBorder(Rectangle.NO_BORDER);
      cell.setBorderWidth(0);
      header1.addCell(cell);
      header1.setTotalWidth(document.getPageSize().getWidth() - document.leftMargin() - document.rightMargin());
      document.add(header1);
      document.add(header2);
      document.add(adresse);
View Full Code Here

  private PdfPTable getHeatTable() {
    float[] tableWidth = { 0.07f, 0.45f, 0.28f, 0.20f };
    PdfPTable table = new PdfPTable(tableWidth);

    // add Column titles
    PdfPCell c21 = new PdfPCell(new Phrase("NR", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    c21.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(c21);
    PdfPCell c22 = new PdfPCell(new Phrase("Nume", normalHeaderFont));
    c22.setHorizontalAlignment(Element.ALIGN_CENTER);
    c22.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(c22);
    PdfPCell c23 = new PdfPCell(new Phrase("Club", normalHeaderFont));
    c23.setHorizontalAlignment(Element.ALIGN_CENTER);
    c23.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(c23);
    PdfPCell c24 = new PdfPCell(new Phrase("Timp", normalHeaderFont));
    c24.setHorizontalAlignment(Element.ALIGN_CENTER);
    c24.setVerticalAlignment(Element.ALIGN_CENTER);
    table.addCell(c24);

    // lane 1 cells
    PdfPCell c31 = new PdfPCell(new Phrase(Integer.toString(heat.getLane1().getLaneNumber()), normalFont));
    table.addCell(c31);
    PdfPCell c32 = new PdfPCell(new Phrase(heat.getLane1().getSwimmer().getName(), normalFont));
    table.addCell(c32);
    PdfPCell c33 = new PdfPCell(new Phrase(heat.getLane1().getSwimmer().getClub(), normalFont));
    table.addCell(c33);
    table.addCell(new PdfPCell());

    // lane 2 cells
    PdfPCell c41 = new PdfPCell(new Phrase(Integer.toString(heat.getLane2().getLaneNumber()), normalFont));
    table.addCell(c41);
    PdfPCell c42 = new PdfPCell(new Phrase(heat.getLane2().getSwimmer().getName(), normalFont));
    table.addCell(c42);
    PdfPCell c43 = new PdfPCell(new Phrase(heat.getLane2().getSwimmer().getClub(), normalFont));
    table.addCell(c43);
    table.addCell(new PdfPCell());

    // lane 3 cells
    PdfPCell c51 = new PdfPCell(new Phrase(Integer.toString(heat.getLane3().getLaneNumber()), normalFont));
    table.addCell(c51);
    PdfPCell c52 = new PdfPCell(new Phrase(heat.getLane3().getSwimmer().getName(), normalFont));
    table.addCell(c52);
    PdfPCell c53 = new PdfPCell(new Phrase(heat.getLane3().getSwimmer().getClub(), normalFont));
    table.addCell(c53);
    table.addCell(new PdfPCell());

    // lane 4 cells
    PdfPCell c61 = new PdfPCell(new Phrase(Integer.toString(heat.getLane4().getLaneNumber()), normalFont));
    table.addCell(c61);
    PdfPCell c62 = new PdfPCell(new Phrase(heat.getLane4().getSwimmer().getName(), normalFont));
    table.addCell(c62);
    PdfPCell c63 = new PdfPCell(new Phrase(heat.getLane4().getSwimmer().getClub(), normalFont));
    table.addCell(c63);
    table.addCell(new PdfPCell());

    // lane 5 cells
    PdfPCell c71 = new PdfPCell(new Phrase(Integer.toString(heat.getLane5().getLaneNumber()), normalFont));
    table.addCell(c71);
    PdfPCell c72 = new PdfPCell(new Phrase(heat.getLane5().getSwimmer().getName(), normalFont));
    table.addCell(c72);
    PdfPCell c73 = new PdfPCell(new Phrase(heat.getLane5().getSwimmer().getClub(), normalFont));
    table.addCell(c73);
    table.addCell(new PdfPCell());

    // lane 6 cells
    PdfPCell c81 = new PdfPCell(new Phrase(Integer.toString(heat.getLane6().getLaneNumber()), normalFont));
    table.addCell(c81);
    PdfPCell c82 = new PdfPCell(new Phrase(heat.getLane6().getSwimmer().getName(), normalFont));
    table.addCell(c82);
    PdfPCell c83 = new PdfPCell(new Phrase(heat.getLane6().getSwimmer().getClub(), normalFont));
    table.addCell(c83);
    table.addCell(new PdfPCell());

    if (event.getPoolType().contains("50")) {

      // lane 7 cells
      PdfPCell c91 = new PdfPCell(new Phrase(Integer.toString(heat.getLane7().getLaneNumber()), normalFont));
      table.addCell(c91);
      PdfPCell c92 = new PdfPCell(new Phrase(heat.getLane7().getSwimmer().getName(), normalFont));
      table.addCell(c92);
      PdfPCell c93 = new PdfPCell(new Phrase(heat.getLane7().getSwimmer().getClub(), normalFont));
      table.addCell(c93);
      table.addCell(new PdfPCell());

      // lane 8 cells
      PdfPCell c101 = new PdfPCell(new Phrase(Integer.toString(heat.getLane8().getLaneNumber()), normalFont));
      table.addCell(c101);
      PdfPCell c102 = new PdfPCell(new Phrase(heat.getLane8().getSwimmer().getName(), normalFont));
      table.addCell(c102);
      PdfPCell c103 = new PdfPCell(new Phrase(heat.getLane8().getSwimmer().getClub(), normalFont));
      table.addCell(c103);
      table.addCell(new PdfPCell());
    } // end 50m pool extra lanes

    return table;
  }
View Full Code Here

    int loopNr = 1;

    for (String age : ageGroups) {
      if (operations.searchAgeGroupInResult(results, age, requiredGender)) {
        // Age-group
        PdfPCell c11 = new PdfPCell(new Phrase(getRomanAgeGroup(age) + ". " + age, normalHeaderFont));
        c11.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c11);
        c11.setColspan(8);
        table.addCell(c11);

        for (Result res : results) {
          if (res.getSwimmer().getAgeGroup().equals(age)) {
            // add the swimmer

            if (loopNr > 1 && previousResultTime == res.getResultTime()) {
              classification--;
            } else {
              classification = loopNr;
            }

            PdfPCell c21 = new PdfPCell(new Phrase(
                res.getPerformanceStatus().equals("OK") ? Integer.toString(classification) : "",
                normalFont));
            c21.setHorizontalAlignment(Element.ALIGN_CENTER);
            disableBorders(c21);
            table.addCell(c21);
            PdfPCell c22 = new PdfPCell(new Phrase(res.getSwimmer().getName(), normalFont));
            disableBorders(c22);
            table.addCell(c22);
            PdfPCell c23 = new PdfPCell(new Phrase(res.getSwimmer().getClub(), normalFont));
            disableBorders(c23);
            table.addCell(c23);
            PdfPCell c24 = new PdfPCell(new Phrase(res.getSwimmer().getBirthYear(), normalFont));
            disableBorders(c24);
            table.addCell(c24);
            PdfPCell c25 = new PdfPCell(new Phrase(res.getPerformanceStatus().equals("OK") ? padLeft(
                Integer.toString(res.getResultMinutes()), 2)
                + ":"
                + padLeft(Integer.toString(res.getResultSecondes()), 2)
                + ","
                + padLeft(Integer.toString(res.getResultMSeconds()), 2) : "-", normalFont));
            disableBorders(c25);
            table.addCell(c25);
            PdfPCell c26 = new PdfPCell(new Phrase(
                calculations.calculateFinaPoints(res.getSwimTimeSeconds(),
                    calculations.getBaseTimeForEvent(event, age, requiredGender)), normalFont));
            disableBorders(c26);
            table.addCell(c26);
            PdfPCell c27 = new PdfPCell(new Phrase(Integer.toString((!res.getPerformanceStatus().equals(
                "OK") ? 0 : calculations.calculateLocalPoints(classification))), normalFont));
            disableBorders(c27);
            table.addCell(c27);
            PdfPCell c28 = new PdfPCell(new Phrase((res.getPerformanceStatus().equals("OK") ? ""
                : res.getPerformanceStatus()), normalFont));
            disableBorders(c28);
            table.addCell(c28);
            classification++;
            loopNr++;
            previousResultTime = res.getResultTime();
          }
        }

        classification = 1;
        previousResultTime = 99999;
        loopNr = 1;

        // add empty line
        PdfPCell c31 = new PdfPCell(new Phrase(" ", normalHeaderFont));
        c31.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c31);
        c31.setColspan(8);
        table.addCell(c31);

      }
    }
View Full Code Here

  private PdfPTable getHeatTable() {
    float[] tableWidth = { 0.04f, 0.36f, 0.30f, 0.14f, 0.16f };
    PdfPTable table = new PdfPTable(tableWidth);

    // add Column titles
    PdfPCell c21 = new PdfPCell(new Phrase("Nr", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    disableBorders(c21);
    table.addCell(c21);
    PdfPCell c22 = new PdfPCell(new Phrase("Nume", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    disableBorders(c22);
    table.addCell(c22);
    PdfPCell c23 = new PdfPCell(new Phrase("Club", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    disableBorders(c23);
    table.addCell(c23);
    PdfPCell c24 = new PdfPCell(new Phrase("Categorie", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_CENTER);
    disableBorders(c24);
    table.addCell(c24);
    PdfPCell c25 = new PdfPCell(new Phrase("Timp", normalHeaderFont));
    c21.setHorizontalAlignment(Element.ALIGN_RIGHT);
    disableBorders(c25);
    table.addCell(c25);

    for (Heat heats : heatList) {
      // heat number cell
      PdfPCell c11 = new PdfPCell(new Phrase("Seria " + heats.getHeatNumber(), normalHeaderFont));
      c11.setHorizontalAlignment(Element.ALIGN_CENTER);
      disableBorders(c11);
      c11.setColspan(5);
      table.addCell(c11);

      // lane 1 cells
      PdfPCell c31 = new PdfPCell(new Phrase(Integer.toString(heats.getLane1().getLaneNumber()), normalFont));
      c31.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c31);
      table.addCell(c31);
      PdfPCell c32 = new PdfPCell(new Phrase(heats.getLane1().getSwimmer().getName(), normalFont));
      c32.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c32);
      table.addCell(c32);
      PdfPCell c33 = new PdfPCell(new Phrase(heats.getLane1().getSwimmer().getClub(), normalFont));
      c33.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c33);
      table.addCell(c33);
      PdfPCell c34 = new PdfPCell(new Phrase(heats.getLane1().getSwimmer().getAgeGroup(), normalFont));
      c34.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c34);
      table.addCell(c34);
      PdfPCell c35;
      try {
        c35 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane1().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane1().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane1().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c35 = new PdfPCell(new Phrase(""));
      }
      c35.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c35);
      table.addCell(c35);

      // lane 2 cells
      PdfPCell c41 = new PdfPCell(new Phrase(Integer.toString(heats.getLane2().getLaneNumber()), normalFont));
      c41.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c41);
      table.addCell(c41);
      PdfPCell c42 = new PdfPCell(new Phrase(heats.getLane2().getSwimmer().getName(), normalFont));
      c42.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c42);
      table.addCell(c42);
      PdfPCell c43 = new PdfPCell(new Phrase(heats.getLane2().getSwimmer().getClub(), normalFont));
      c43.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c43);
      table.addCell(c43);
      PdfPCell c44 = new PdfPCell(new Phrase(heats.getLane2().getSwimmer().getAgeGroup(), normalFont));
      c44.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c44);
      table.addCell(c44);
      PdfPCell c45;
      try {
        c45 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane2().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane2().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane2().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c45 = new PdfPCell(new Phrase(""));
      }
      c45.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c45);
      table.addCell(c45);

      // lane 3 cells
      PdfPCell c51 = new PdfPCell(new Phrase(Integer.toString(heats.getLane3().getLaneNumber()), normalFont));
      c51.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c51);
      table.addCell(c51);
      PdfPCell c52 = new PdfPCell(new Phrase(heats.getLane3().getSwimmer().getName(), normalFont));
      c52.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c52);
      table.addCell(c52);
      PdfPCell c53 = new PdfPCell(new Phrase(heats.getLane3().getSwimmer().getClub(), normalFont));
      c53.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c53);
      table.addCell(c53);
      PdfPCell c54 = new PdfPCell(new Phrase(heats.getLane3().getSwimmer().getAgeGroup(), normalFont));
      c54.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c54);
      table.addCell(c54);
      PdfPCell c55;
      try {
        c55 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane3().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane3().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane3().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c55 = new PdfPCell(new Phrase(""));
      }
      c55.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c55);
      table.addCell(c55);

      // lane 4 cells
      PdfPCell c61 = new PdfPCell(new Phrase(Integer.toString(heats.getLane4().getLaneNumber()), normalFont));
      c61.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c61);
      table.addCell(c61);
      PdfPCell c62 = new PdfPCell(new Phrase(heats.getLane4().getSwimmer().getName(), normalFont));
      c62.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c62);
      table.addCell(c62);
      PdfPCell c63 = new PdfPCell(new Phrase(heats.getLane4().getSwimmer().getClub(), normalFont));
      c63.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c63);
      table.addCell(c63);
      PdfPCell c64 = new PdfPCell(new Phrase(heats.getLane4().getSwimmer().getAgeGroup(), normalFont));
      c64.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c64);
      table.addCell(c64);
      PdfPCell c65;
      try {
        c65 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane4().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane4().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane4().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c65 = new PdfPCell(new Phrase(""));
      }
      c65.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c65);
      table.addCell(c65);

      // lane 5 cells
      PdfPCell c71 = new PdfPCell(new Phrase(Integer.toString(heats.getLane5().getLaneNumber()), normalFont));
      c71.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c71);
      table.addCell(c71);
      PdfPCell c72 = new PdfPCell(new Phrase(heats.getLane5().getSwimmer().getName(), normalFont));
      c72.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c72);
      table.addCell(c72);
      PdfPCell c73 = new PdfPCell(new Phrase(heats.getLane5().getSwimmer().getClub(), normalFont));
      c73.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c73);
      table.addCell(c73);
      PdfPCell c74 = new PdfPCell(new Phrase(heats.getLane5().getSwimmer().getAgeGroup(), normalFont));
      c74.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c74);
      table.addCell(c74);
      PdfPCell c75;
      try {
        c75 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane5().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane5().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane5().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c75 = new PdfPCell(new Phrase(""));
      }
      c75.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c75);
      table.addCell(c75);

      // lane 6 cells
      PdfPCell c81 = new PdfPCell(new Phrase(Integer.toString(heats.getLane6().getLaneNumber()), normalFont));
      c81.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c81);
      table.addCell(c81);
      PdfPCell c82 = new PdfPCell(new Phrase(heats.getLane6().getSwimmer().getName(), normalFont));
      c82.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c82);
      table.addCell(c82);
      PdfPCell c83 = new PdfPCell(new Phrase(heats.getLane6().getSwimmer().getClub(), normalFont));
      c83.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c83);
      table.addCell(c83);
      PdfPCell c84 = new PdfPCell(new Phrase(heats.getLane6().getSwimmer().getAgeGroup(), normalFont));
      c84.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c84);
      table.addCell(c84);
      PdfPCell c85;
      try {
        c85 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane6().getEntryMinutes()), 2) + ":"
            + padLeft(Integer.toString(heats.getLane6().getEntrySecondes()), 2) + ","
            + padLeft(Integer.toString(heats.getLane6().getEntryMSeconds()), 2), normalFont));
      } catch (NullPointerException e) {
        c85 = new PdfPCell(new Phrase());
      }
      c85.setHorizontalAlignment(Element.ALIGN_LEFT);
      disableBorders(c85);
      table.addCell(c85);

      if (event.getPoolType().contains("50")) {

        // lane 7 cells
        PdfPCell c91 = new PdfPCell(new Phrase(Integer.toString(heats.getLane7().getLaneNumber()), normalFont));
        c91.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c91);
        table.addCell(c91);
        PdfPCell c92 = new PdfPCell(new Phrase(heats.getLane7().getSwimmer().getName(), normalFont));
        c92.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c92);
        table.addCell(c92);
        PdfPCell c93 = new PdfPCell(new Phrase(heats.getLane7().getSwimmer().getClub(), normalFont));
        c93.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c93);
        table.addCell(c93);
        PdfPCell c94 = new PdfPCell(new Phrase(heats.getLane7().getSwimmer().getAgeGroup(), normalFont));
        c94.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c94);
        table.addCell(c94);
        PdfPCell c95;
        try {
          c95 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane7().getEntryMinutes()), 2)
              + ":" + padLeft(Integer.toString(heats.getLane7().getEntrySecondes()), 2) + ","
              + padLeft(Integer.toString(heats.getLane7().getEntryMSeconds()), 2), normalFont));
          c95.setHorizontalAlignment(Element.ALIGN_LEFT);
        } catch (NullPointerException e) {
          c95 = new PdfPCell(new Phrase(""));
        }
        disableBorders(c95);
        table.addCell(c95);

        // lane 8 cells
        PdfPCell c10_1 = new PdfPCell(
            new Phrase(Integer.toString(heats.getLane8().getLaneNumber()), normalFont));
        c10_1.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_1);
        table.addCell(c10_1);
        PdfPCell c10_2 = new PdfPCell(new Phrase(heats.getLane8().getSwimmer().getName(), normalFont));
        c10_2.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_2);
        table.addCell(c10_2);
        PdfPCell c10_3 = new PdfPCell(new Phrase(heats.getLane8().getSwimmer().getClub(), normalFont));
        c10_3.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_3);
        table.addCell(c10_3);
        PdfPCell c10_4 = new PdfPCell(new Phrase(heats.getLane8().getSwimmer().getAgeGroup(), normalFont));
        c10_4.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_4);
        table.addCell(c10_4);
        PdfPCell c10_5;
        try {
          c10_5 = new PdfPCell(new Phrase(padLeft(Integer.toString(heats.getLane8().getEntryMinutes()), 2)
              + ":" + padLeft(Integer.toString(heats.getLane8().getEntrySecondes()), 2) + ","
              + padLeft(Integer.toString(heats.getLane8().getEntryMSeconds()), 2), normalFont));
        } catch (NullPointerException e) {
          c10_5 = new PdfPCell(new Phrase(""));
        }
        c10_5.setHorizontalAlignment(Element.ALIGN_LEFT);
        disableBorders(c10_5);
        table.addCell(c10_5);
      } // end 50m pool extra lanes

      // add empty line after each heat
      PdfPCell c11_1 = new PdfPCell(new Phrase(" "));
      c11_1.setHorizontalAlignment(Element.ALIGN_CENTER);
      disableBorders(c11_1);
      table.addCell(c11_1);
      PdfPCell c11_2 = new PdfPCell(new Phrase(" "));
      disableBorders(c11_2);
      table.addCell(c11_2);
      PdfPCell c11_3 = new PdfPCell(new Phrase(" "));
      disableBorders(c11_3);
      table.addCell(c11_3);
      PdfPCell c11_4 = new PdfPCell(new Phrase(" "));
      disableBorders(c11_4);
      table.addCell(c11_4);
      PdfPCell c11_5 = new PdfPCell(new Phrase(" "));
      disableBorders(c11_5);
      table.addCell(c11_5);

    }
View Full Code Here

    private ArrayList<Chunk> chunks = new ArrayList<Chunk>();
    private PdfPCell cell;

    /** Creates a new instance of IncCell */
    public IncCell(String tag, ChainedProperties props) {
        cell = new PdfPCell((Phrase)null);
        String value = props.getProperty("colspan");
        if (value != null)
            cell.setColspan(Integer.parseInt(value));
        value = props.getProperty("rowspan");
        if (value != null)
View Full Code Here

            if (columnHeader == null)
            {
                columnHeader = StringUtils.capitalize(headerCell.getBeanPropertyName());
            }

            PdfPCell hdrCell = getCell(columnHeader);
            hdrCell.setGrayFill(0.9f);
            tablePDF.addCell(hdrCell);

        }
        tablePDF.setHeaderRows(1);
    }
View Full Code Here

                Column column = columnIterator.nextColumn();

                // Get the value to be displayed for the column
                Object value = column.getValue(this.decorated);

                PdfPCell cell = getCell(value != null ? value.toString() : StringUtils.EMPTY);
                tablePDF.addCell(cell);
            }
        }
    }
View Full Code Here

     * @param value cell value
     * @return Cell
     */
    private PdfPCell getCell(String value)
    {
        PdfPCell cell = new PdfPCell(new Phrase(new Chunk(StringUtils.trimToEmpty(value), smallFont)));
        cell.setVerticalAlignment(Element.ALIGN_TOP);
        cell.setLeading(8, 0);
        cell.setPadding(2);
        return cell;
    }
View Full Code Here

            if (columnHeader == null)
            {
                columnHeader = StringUtils.capitalize(headerCell.getBeanPropertyName());
            }

            PdfPCell hdrCell = this.getHeaderCell(columnHeader);
            this.table.addCell(hdrCell);
        }
        table.setHeaderRows(1);
        this.table.setWidths(widths);
    }
View Full Code Here

TOP

Related Classes of com.itextpdf.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.