Isys_report_fpdf.class.php
-
Hi liebe Developer!
Ich habe mal ein paar Zeilen zur Berechung der Spaltenbreite für die PDF-Reports in obige PHP-Datei eingebaut. Hierdurch werden die Spalten in vernünftiger Spaltenbreite erzeugt. Vielleicht könnt ihr die paar Zeilen gebrauchen….
61a62,77
// Width
$widths = array();
for($i=0;$i<count($header);$i++) {<br="">> $widths[$i] = strlen($header[$i])*2;
}
foreach($data as $row) {
$count = 0;
foreach($row as $l_table => $l_value) {
if (strlen($l_value)*2 > $widths[$count]) {
$widths[$count] = strlen($l_value)*2;
}
$count++;
}
}64,65c80,81
< $this->Cell(strlen($header[$i])*7,7,$header[$i],1,0,'C',1);
< $l_sum += strlen($header[$i])*7;
–-$this->Cell($widths[$i],7,$header[$i],1,0,'C',1);
$l_sum += $widths[$i];
82,85c98,101
< // if (!preg_match("/^[\w]+$/i", $l_table)) {
< $this->Cell(strlen($header[$i])*7, 6, $g_comp_template_language_manager->get($l_value), 'LR', 0, 'L', 1);
< $i++;
< // }
–-
if (!preg_match("/^[\w]+$/i", $l_table)) {
$this->Cell($widths[$i], 6, $g_comp_template_language_manager->get($l_value), 'LR', 0, 'L', 1);
$i++;
}Ansonsten braucht der PDF-Export noch ein paar andere Einstellmöglichkeiten (Papierformat, Papiergröße etc.).
Gruß
Christof</count($header);$i++)> -
Hallo,
danke für die Mühe, ich werde das mal einbauen und testen.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login