Ankündigung

Einklappen
Keine Ankündigung bisher.

Fpdf Tabelle Zeilenhöhe vergrößern

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Fpdf Tabelle Zeilenhöhe vergrößern

    Hallo
    Ich verwende fpdf um eine Liste für einen Sportwettbewerb zu erstellen.
    Dort erstelle ich eine Tabelle. Ich möchte jetzt die Zeilen der Tabelle in der Höhe vergrößern.


    Here mein code:

    PHP-Code:
    <?php
    require('mysql_table.php');


    //Connect to database
    mysql_connect('host','user','pwd');
    mysql_select_db('db');


    $sql "SELECT @rownum:= @rownum+1 ROWNUM, if (id_sport = 3,': ,',' ,') as format, if(id_sport >= 4,' , ','') as v1,if(id_sport >= 4,' , ','') as v2,if(id_sport >= 4,' , ','') as v3, t.*
    FROM
    (SELECT @rownum:=0) r,
    (SELECT
    main.id_anmeldung AS Person_ID, bewerb, Einheit, gruppe, geschlecht, schule, jahrgang, anmeldung_gruppe.veranstaltung,
    anmeldung_gruppe.vorname AS Vorname,
    anmeldung_gruppe.nachname AS Nachname, main.id_ergebnis, main.id_sport,
    main.ergebnis AS Punkte
    FROM
    ergebnisse main, anmeldung_gruppe, sport
    where main.id_anmeldung= anmeldung_gruppe.id_anmeldung and sport.id_sport = main.id_sport and gruppe= "
    .$_GET['gruppe']." and main.id_sport = ".$_GET['id_sport']." and event = ".$_GET['event']." and geschlecht = '".$_GET['geschlecht']."'
    ORDER BY anmeldung_gruppe.nachname, anmeldung_gruppe.vorname) t"
    ;

    $result mysql_query $sql );
    $row mysql_fetch_array $result );
    $bewerb $row['bewerb'];
    $veranstaltung $row['veranstaltung'];
    $geschlecht $row['geschlecht'];
    $schule $row['schule'];
    $einheit $row['Einheit'];

    if (
    $geschlecht == "w") {$geschlecht "weiblich"; } else { $geschlecht utf8_decode("männlich"); }

    switch (
    $row['gruppe']) {
    case 
    1:
    $gruppe utf8_decode("Schüler II - 10-12 Jahre");
    break;
    case 
    2:
    $gruppe utf8_decode("Schüler I - 13/14 Jahre");
    break;
    case 
    3:
    $gruppe "Jugend - 15/16 Jahre";
    break;
    case 
    4:
    $gruppe "Junior - 17-19 Jahre";
    break;
    }


    class 
    PDF extends PDF_MySQL_Table
    {
    function 
    __construct() {
    parent::__construct("P""mm""A4"); // L=Querformat(Landscape), P=Hochformat(Portrait)
    }

    function 
    AutoPrint($printer='')
    {
    // Open the print dialog
    if($printer)
    {
    $printer str_replace('\\''\\\\'$printer);
    $script "var pp = getPrintParams();";
    $script .= "pp.interactive = pp.constants.interactionLevel.full;";
    $script .= "pp.printerName = '$printer'";
    $script .= "print(pp);";
    }
    else
    $script 'print(true);';
    $this->IncludeJS($script);
    }

    function 
    Header()
    {
    global 
    $bewerb$gruppe$veranstaltung$geschlecht;
    //Title
    $this->SetFont('Arial','',18);
    $this->SetTextColor(255,0,0);
    $this->Cell(0,6,'Startliste ',0,1,'C');
    $this->SetTextColor(0,0,0);
    $this->SetFont('Arial','',16);
    $this->Cell(0,6,$veranstaltung,0,1,'C');
    $this->SetFont('Arial','',14);
    $this->SetXY(30,25);
    $this->Cell(30,6,$bewerb,0,0,'L');
    $this->SetXY(20,25);
    $this->Cell(0,6,$gruppe,0,0,'C');
    $this->SetXY(-15,25);
    $this->Cell(-15,6,$geschlecht,0,0,'R');
    $this->Rect(24251626);
    $this->Ln(10);

    //Ensure table header is output
    parent::Header();
    }

    function 
    Footer() {
    // Farben und Schrift allgemein
    //$this->SetFont("Courier","I","9");
    //$this->SetTextColor(180);

    // Seitenzahl
    $this->SetY(-15);
    $this->Cell(0,10,'Seite '.$this->PageNo().'/{nb}',0,0,'C');
    $this->SetXY(10,-15);
    $this->Cell(010date("d.m.Y H:i:s"), 00"L");
    $this->SetXY(10,-15);
    $this->Cell(010"Auswertung: Harald Hochl"00"R");
    //$this->SetDrawColor(0, 0, 255);
    // Linienbreite einstellen, 0.5 mm
    //$this->SetLineWidth(0.5);
    $this->Line(10283200283);



    }
    }

    $pdf=new PDF();
    //First table: put all columns automatically

    $pdf->AliasNbPages();

    $pdf->AddPage();
    //$pdf->SetFont('Arial','',20);
    //$pdf->SetTextColor(255,255,255);
    //$pdf->SetFont('Arial','',42);
    $pdf->AddCol('ROWNUM',7,'Nr.','R');
    $pdf->AddCol('Nachname',28,'Nachname','L');
    $pdf->AddCol('Vorname',22,'Vorname','L');
    $pdf->AddCol('jahrgang',11,'Jahrg.','C');
    $pdf->AddCol('schule',40,'Schule','L');
    if (
    $_GET['id_sport'] >= 4) {
    $pdf->AddCol('v1',20,'1.Vers.','C');
    $pdf->AddCol('v2',20,'2.Vers.','C');
    $pdf->AddCol('v3',20,'3.Vers.','C');

    } else {
    $pdf->AddCol('format',37,'Ergebnis','C');
    }
    $pdf->AddCol('Einheit',10,' ','L');
    $prop=array('HeaderColor'=>array(163,233,250),
    'color1'=>array(230,230,230),
    'color2'=>array(248,248,248),
    'padding'=>1,
    'margin'=>10);
    //$pdf->SetTextColor(0,0,0);
    $pdf->Table($sql,$prop);



    $pdf->AutoPrint(); //Druckmenü automatisch öffnen

    $pdf->Output();
    ?>
    Die Tabelle beginnt bei

    $pdf->AddCol('ROWNUM',7,'Nr.','R');

    Vielen Dank für jede Antwort


  • #2
    setFontSize
    Doku lesen zu bestimmten Softwareprodukten ist nicht unsere Aufgabe und weit weg vom PHP Einsteigerthema.

    Kommentar


    • #3
      Bitte beachten: Fachfragen zu bestimmten Softwareprodukten

      Und - als Info - Crossposts sind nicht erlaubt. Das Format des Beitrages sieht aus, als hättest du das aus einem anderen Forum einfach mal so auskopiert.

      MOD: Verschoben von PHP-Einsteiger
      The string "()()" is not palindrom but the String "())(" is.

      Debugging: Finde DEINE Fehler selbst! | Gegen Probleme beim E-Mail-Versand | Sicheres Passwort-Hashing | Includes niemals ohne __DIR__
      PHP.de Wissenssammlung | Kein Support per PN

      Kommentar


      • #4
        Zitat von protestix Beitrag anzeigen
        setFontSize
        Doku lesen zu bestimmten Softwareprodukten ist nicht unsere Aufgabe und weit weg vom PHP Einsteigerthema.
        ich glaube der will Ceell/MultiCell und der Code ist glaube ich hier aus dem Forum...

        Kommentar


        • #5
          und der Code ist glaube ich hier aus dem Forum...
          hmmm, dann aber sehr alt...
          PHP-Code:
          mysql_connect('host','user','pwd'); 
          ...
          mysql_query $sql ); 
          sollte schon mal einen Fehler werfen, da veraltet. siehe Handbuch roter Kasten.

          Kommentar

          Lädt...
          X