Welcome Guest, Not a member yet? Register   Sign In
domPDF not outputing data form db to PDF
#11

[eluser]Otemu[/eluser]
Try this:
Render the page without dompdf with the database driven data
copy the html
now test with dompdf to see if it actually the rendered html causing the issue.
On the wiki it says bad formed html can break it.

Are you using row array or results array within your model??
#12

[eluser]the_unforgiven[/eluser]
Does no one read previous posts around here, I have done this already! see above! And am using both row array and result array
#13

[eluser]the_unforgiven[/eluser]
Tried it with just html and two lines of php and still nothing on the php side but the html renders: see image: http://d.pr/i/fig9

#14

[eluser]the_unforgiven[/eluser]
Done a test page to var_dump() each varible and here's the output so the vars are working just not with domPDF

Code:
array(9) { ["order_id"]=> string(2) "14" ["product_id"]=> string(1) "7" ["customers_id"]=> string(1) "1" ["item_ordered"]=> string(11) "New Product" ["qty"]=> string(2) "12" ["order_amount"]=> string(5) "23.99" ["order_date"]=> string(19) "2012-12-18 19:19:34" ["order_status"]=> string(9) "Cancelled" ["other"]=> string(0) "" }

array(29) { ["id"]=> string(1) "1" ["fullname"]=> string(11) "A Customer" ["firstname"]=> string(3) "A" ["lastname"]=> string(7) "Customer" ["address1"]=> string(27) "10 Downing Street " ["address2"]=> string(8) "Address Somewhere" ["town"]=> string(9) "Some Town" ["city"]=> string(6) "A City" ["county"]=> string(8) "A County" ["country"]=> string(14) "United Kingdom" ["postcode"]=> string(7) "AS09ED" ["email"]=> string(22) "[email protected]" ["username"]=> string(8) "testuser" ["password"]=> string(40) "516fa3fd6bf97a4b3ff09ec93877d39005a7996d" ["tel"]=> string(11) "01122334455" ["pay_method"]=> string(3) "---" ["status"]=> string(1) "1" ["activation_code"]=> string(31) "wppBXNMGaYn3bnA4leHXDwxMmWLocqO" ["activated"]=> string(1) "1" ["created"]=> string(10) "2013-01-01" ["order_id"]=> NULL ["product_id"]=> NULL ["customers_id"]=> NULL ["item_ordered"]=> NULL ["qty"]=> NULL ["order_amount"]=> NULL ["order_date"]=> NULL ["order_status"]=> NULL ["other"]=> NULL }
#15

[eluser]the_unforgiven[/eluser]
Figured it out I had $data = array(); in the code if you look and i commented that out it then worked!

But one small problem I have now is this:

DOMPDF_ENABLE_REMOTE is set to FALSE http://localhost/hb/assets/image/logo.png which should show the logo but doesnt any idea's
#16

[eluser]Nicemotion[/eluser]
Dear all,
i have a similar problem: all works perfectly but the dynamic data (lol).. it gives me a sintax T_STRING error in the query echo lines tho the html looks correct on a normal html page...

Any idea ?
Ty in advance

Code:
<?php
require_once('Connections/tao_conn.php');

mysql_select_db($database_tao_conn, $tao_conn);
$query_Pagamenti = "SELECT * FROM pagamenti  INNER JOIN iscrizioni ON pagamenti.iscrizioni_idiscrizioni = iscrizioni.idiscrizioni  INNER JOIN utenti ON iscrizioni.utenti_idutenti = utenti.idutenti  LEFT JOIN fatture_has_pagamenti ON fatture_has_pagamenti.pagamenti_idpagamenti = pagamenti.idpagamenti  LEFT JOIN fatture ON fatture.utenti_idutenti = iscrizioni.utenti_idutenti  INNER JOIN diz_iva ON diz_iva.iddiz_iva = fatture.diz_iva_iddiz_iva WHERE iscrizioni.utenti_idutenti = utenti.idutenti";
$Pagamenti = mysql_query($query_Pagamenti, $tao_conn) or die(mysql_error());
$row_Pagamenti = mysql_fetch_assoc($Pagamenti);
$totalRows_Pagamenti = mysql_num_rows($Pagamenti);

require_once("resources/dompdf/dompdf_config.inc.php");
$filename = "pdf test";
$html ='<html><body>'.
  '<table width="100%" border="0">
        <tr>
          <td>ID Pago</td>
          <td>Importo</td>
          <td>Data</td>
          <td>Descrizione</td>
          <td>IVA %</td>
          <td>IVA</td>
           </tr>
        &lt;?php do { ?&gt;
           <tr>
###  following 5 lines gives problem ###
             <td>&lt;?php echo $row_Pagamenti['idpagamenti']; ?&gt;</td>
             <td>&lt;?php echo $row_Pagamenti['pagatoimporto']; ?&gt;</td>
             <td>&lt;?php echo $row_Pagamenti['pagatodata']; ?&gt;</td>
             <td>&lt;?php echo $row_Pagamenti['descpago']; ?&gt;</td>
             <td>&lt;?php echo $row_Pagamenti['iva_pct']; ?&gt;</td>
             <td>&nbsp;</td>
              </tr>
          &lt;?php } while ($row_Pagamenti = mysql_fetch_assoc($Pagamenti)); ?&gt;
                  </table>'.
  '&lt;/body&gt;&lt;/html>';

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream($filename . ".pdf");

?&gt;




Theme © iAndrew 2016 - Forum software by © MyBB