A voir également:
- Problème d'affichage d'un rapport avec tcpdf
- Plan d'un rapport de stage - Guide
- Affichage double ecran - Guide
- Problème affichage fenêtre windows 10 - Guide
- Windows 11 affichage classique - Guide
- Problème affichage page internet google chrome ✓ - Forum Google Chrome
5 réponses
Bonjour,
Je pense que tu as mal placé ta variable $text ...
il faut la mettre AVANT de l'utiliser .....
donc... avant ta variable $html
Je pense que tu as mal placé ta variable $text ...
il faut la mettre AVANT de l'utiliser .....
donc... avant ta variable $html
Merci de vouloir m'aider
je l'ai deplacé ainsi:
c'est à dire j'ai pacé avant le premier IF, mais je remarque que la première ligne du mois 11 s'affiche après la dernière ligne du mois 10 dans la première page, et la première ligne du mois 12 safiiche après la dernière ligne du mois 11 dans la 2 ème page et la 3 ème page reste toujours vide sans le reste de données du mois 12.
Merci de me dire encore ce que je dois faire.
je l'ai deplacé ainsi:
<?php include '../function/configConnexion.php'; @session_start(); if (!isset($_SESSION['cusr'])) { header("Location:../index.php"); } //updateHistorique($_SESSION['cusr'],"Impression de la liste des mouvements de stock"); // Include the main TCPDF library (search for installation path). // Include the main TCPDF library (search for installation path). require_once('tcpdf/examples/config/tcpdf_config_alt.php'); require_once('tcpdf/tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Félix'); $pdf->SetTitle('Etat des implantations par zone'); $pdf->SetSubject('Rapport'); $pdf->SetKeywords('Felix, PMUC'); // set default header data //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set some language-dependent strings (optional) if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { require_once(dirname(__FILE__).'/lang/eng.php'); $pdf->setLanguageArray($l); } // --------------------------------------------------------- // set font $pdf->SetFont('dejavusans', '', 10); // add a page $pdf->AddPage(); $html = '<h1 style="text-align:center">ETAT DES POINTS COURSES</h1><br/><br/>'; $pdf->writeHTML($html, true, false, true, false, ''); $reqq = "SELECT * FROM region WHERE idRegion='$_GET[region1]' "; $rss = mysql_query($reqq);$i=1; while ($lignee = mysql_fetch_array($rss)) { extract($lignee); } $req = "SELECT reparation.*,month(dateRep) as mois, codeKiosque,libelle FROM reparation, kiosque,pointcourse where year(dateRep)='$_GET[annee1]' and idRegion= '$_GET[region1]' and Montant>0 and reparation.idKiosque=kiosque.idKiosque and reparation.lastPc=pointcourse.idPointCourse order by dateRep asc " ; $rs = mysql_query($req);$i=1;$position=0; $zone = ""; $text = ""; $html = ""; while ($ligne = mysql_fetch_array($rs)) { extract($ligne); $text .= '<tr> <td align="center" >'.$i.'</td> <td align="center" >'.$dateRep.'</td> <td align="center">'.$mois.'</td> <td align="center">'.$codeKiosque.'</td> <td align="center" >'.$Montant.'</td> <td align="center" >'.$technicien.'</td> <td align="center" >'.$libelle.'</td> </tr> '; if ($position==0) { $zone = $mois; } if ($zone!=$mois) { $zone = $mois; $html = '<table width="100%" border="1" cellpadding="2" cellspacing="0"> <tr> <td colspan="7" align="center">'. $nomRegion.'</td> </tr> <tr> <td width="8%" height="20" bgcolor="#E561A0" > ligne</td> <td width="17%" align="center" bgcolor="#E561A0" >Date</td> <td width="10%" align="center" bgcolor="#E561A0" >Mois</td> <td width="10%" align="center" bgcolor="#E561A0" >Kiosque</td> <td width="10%" align="center" bgcolor="#E561A0" >Montant</td> <td width="10%" align="center" bgcolor="#E561A0">Prestataire</td> <td width="35%" align="center" bgcolor="#E561A0">Dernier point course</td> </tr>'.$text.' <tr> <td colspan="7" align="center">Total : '.($i-1).'</td> </tr> </table>'; // output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); // ecriture de texte dans le document PDF $text = ""; $html = ""; $i = 1; /*******SAUT DE PAGE *****/ // reset pointer to the last page $pdf->lastPage(); // add a page $pdf->AddPage(); /*******FIN SAUT DE PAGE *****/ } $i++;$position=1; } $pdf->writeHTML('<table width="100%" border="1" cellpadding="2" cellspacing="0"> <tr> <td colspan="7" align="center">'.$nomRegion.'</td> </tr> <tr> <td width="8%" height="20" bgcolor="#E561A0" > ligne</td> <td width="17%" align="center" bgcolor="#E561A0" >Date</td> <td width="10%" align="center" bgcolor="#E561A0" >Mois</td> <td width="10%" align="center" bgcolor="#E561A0" >Kiosque</td> <td width="10%" align="center" bgcolor="#E561A0" >Montant</td> <td width="10%" align="center" bgcolor="#E561A0">Prestataire</td> <td width="35%" align="center" bgcolor="#E561A0">Dernier point course</td> </tr>'.$text.' <tr> <td colspan="7" align="center">Total : '.($i-1).'</td> </tr> </table>', true, false, true, false, ''); // --------------------------------------------------------- //Close and output PDF document $pdf->Output('etat_implantation.pdf', 'I'); //============================================================+ // END OF FILE //============================================================+ ?>
c'est à dire j'ai pacé avant le premier IF, mais je remarque que la première ligne du mois 11 s'affiche après la dernière ligne du mois 10 dans la première page, et la première ligne du mois 12 safiiche après la dernière ligne du mois 11 dans la 2 ème page et la 3 ème page reste toujours vide sans le reste de données du mois 12.
Merci de me dire encore ce que je dois faire.
J'ai essayé de le refaire (de tête...)
A mon avis... tu avais un problème dans l'enchainement de tes instructions (et la fermeture de tes tableaux;...)
Essayes ça et dis nous ce que ça donne :
A mon avis... tu avais un problème dans l'enchainement de tes instructions (et la fermeture de tes tableaux;...)
Essayes ça et dis nous ce que ça donne :
<?php include '../function/configConnexion.php'; @session_start(); if (!isset($_SESSION['cusr'])) { header("Location:../index.php"); } //updateHistorique($_SESSION['cusr'],"Impression de la liste des mouvements de stock"); // Include the main TCPDF library (search for installation path). // Include the main TCPDF library (search for installation path). require_once('tcpdf/examples/config/tcpdf_config_alt.php'); require_once('tcpdf/tcpdf.php'); // create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Félix'); $pdf->SetTitle('Etat des implantations par zone'); $pdf->SetSubject('Rapport'); $pdf->SetKeywords('Felix, PMUC'); // set default header data //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 006', PDF_HEADER_STRING); // set header and footer fonts $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); // set some language-dependent strings (optional) if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { require_once(dirname(__FILE__).'/lang/eng.php'); $pdf->setLanguageArray($l); } // --------------------------------------------------------- // set font $pdf->SetFont('dejavusans', '', 10); // add a page $pdf->AddPage(); $html = '<h1 style="text-align:center">ETAT DES POINTS COURSES</h1><br/><br/>'; $pdf->writeHTML($html, true, false, true, false, ''); $reqq = "SELECT * FROM region WHERE idRegion='$_GET[region1]' "; $rss = mysql_query($reqq);$i=1; while ($lignee = mysql_fetch_array($rss)){ extract($lignee); } $region1 = !empty($_GET['region1']) ? $_GET['region1'] : ''; $annee1 = !empty($_GET['annee1']) ? $_GET['annee1'] : ''; $req = "SELECT reparation.* ,month(dateRep) as mois , codeKiosque ,libelle FROM reparation , kiosque ,pointcourse WHERE year(dateRep)='$annee1' AND idRegion= '$resiong1' AND Montant>0 and reparation.idKiosque=kiosque.idKiosque AND reparation.lastPc=pointcourse.idPointCourse ORDER BY dateRep ASC " ; $rs = mysql_query($req); $i=1; $position=0; $moi_prec = ""; $text = ""; $html = ""; while ($ligne = mysql_fetch_array($rs)){ extract($ligne); if ($moi_prec!=$mois && $position !=0) { $html .=' <tr> <td colspan="7" align="center">Total : '.($i-1).'</td> </tr> </table>'; // output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); // ecriture de texte dans le document PDF $text = ""; $html = ""; /*******SAUT DE PAGE *****/ // reset pointer to the last page $pdf->lastPage(); // add a page $pdf->AddPage(); /*******FIN SAUT DE PAGE *****/ } if ($moi_prec!=$mois) { $html = '<table width="100%" border="1" cellpadding="2" cellspacing="0"> <tr> <td colspan="7" align="center">'. $nomRegion.'</td> </tr> <tr> <td width="8%" height="20" bgcolor="#E561A0" > ligne</td> <td width="17%" align="center" bgcolor="#E561A0" >Date</td> <td width="10%" align="center" bgcolor="#E561A0" >Mois</td> <td width="10%" align="center" bgcolor="#E561A0" >Kiosque</td> <td width="10%" align="center" bgcolor="#E561A0" >Montant</td> <td width="10%" align="center" bgcolor="#E561A0">Prestataire</td> <td width="35%" align="center" bgcolor="#E561A0">Dernier point course</td> </tr>'; } $text .= '<tr> <td align="center" >'.$i.'</td> <td align="center" >'.$dateRep.'</td> <td align="center">'.$mois.'</td> <td align="center">'.$codeKiosque.'</td> <td align="center" >'.$Montant.'</td> <td align="center" >'.$technicien.'</td> <td align="center" >'.$libelle.'</td> </tr>'; $html. =$text; $moi_prec=$mois; $position++; $i++; } //une fois la boucle terminée ... pour fermer le dernier tableau et ajouter le contenu au pdf ... if ($position !=0) { $html .=' <tr> <td colspan="7" align="center">Total : '.($i-1).'</td> </tr> </table>'; // output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); // ecriture de texte dans le document PDF } $pdf->writeHTML('<table width="100%" border="1" cellpadding="2" cellspacing="0"> <tr> <td colspan="7" align="center">'.$nomRegion.'</td> </tr> <tr> <td width="8%" height="20" bgcolor="#E561A0" > ligne</td> <td width="17%" align="center" bgcolor="#E561A0" >Date</td> <td width="10%" align="center" bgcolor="#E561A0" >Mois</td> <td width="10%" align="center" bgcolor="#E561A0" >Kiosque</td> <td width="10%" align="center" bgcolor="#E561A0" >Montant</td> <td width="10%" align="center" bgcolor="#E561A0">Prestataire</td> <td width="35%" align="center" bgcolor="#E561A0">Dernier point course</td> </tr>'.$text.' <tr> <td colspan="7" align="center">Total : '.($i-1).'</td> </tr> </table>', true, false, true, false, ''); // --------------------------------------------------------- //Close and output PDF document $pdf->Output('etat_implantation.pdf', 'I'); //============================================================+ // END OF FILE //============================================================+ ?>
jai des lignes qui s'affiche plusierus fois dans un meme mois, je suis passé de 3 à 10 pages. et les données du 12 ème mois ne saffiche toujours pas.
cordialement
cordialement
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Bonjour
Je voudrais dire que le script que jordane m'a envoyé fonctionne avec des données en doublons et même plus. Je suis passé de 3 à 10 pages . Et le mois 12 ne s'affiche toujours pas.
Donnez moi d'autres pistes s'il vous plaît.
Cordialement
Je voudrais dire que le script que jordane m'a envoyé fonctionne avec des données en doublons et même plus. Je suis passé de 3 à 10 pages . Et le mois 12 ne s'affiche toujours pas.
Donnez moi d'autres pistes s'il vous plaît.
Cordialement
Si ton souci persiste, commence par nous donner le résultat de la requête
Que l'on sache quelles données elle sort .... et ainsi voir comment faire le traitement php.
SELECT reparation.* ,month(dateRep) as mois , codeKiosque ,libelle FROM reparation , kiosque ,pointcourse WHERE year(dateRep)='$annee1' AND idRegion= '$resiong1' AND Montant>0 and reparation.idKiosque=kiosque.idKiosque AND reparation.lastPc=pointcourse.idPointCourse ORDER BY dateRep ASC
Que l'on sache quelles données elle sort .... et ainsi voir comment faire le traitement php.