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:
Die Tabelle beginnt bei
$pdf->AddCol('ROWNUM',7,'Nr.','R');
Vielen Dank für jede Antwort
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(24, 25, 162, 6);
$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(0, 10, date("d.m.Y H:i:s"), 0, 0, "L");
$this->SetXY(10,-15);
$this->Cell(0, 10, "Auswertung: Harald Hochl", 0, 0, "R");
//$this->SetDrawColor(0, 0, 255);
// Linienbreite einstellen, 0.5 mm
//$this->SetLineWidth(0.5);
$this->Line(10, 283, 200, 283);
}
}
$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();
?>
$pdf->AddCol('ROWNUM',7,'Nr.','R');
Vielen Dank für jede Antwort
Kommentar