EVOLUTION-NINJA
Edit File: pdfreport.php
<?php //============================================================+ // File name : example_048.php // Begin : 2009-03-20 // Last Update : 2013-05-14 // // Description : Example 048 for TCPDF class // HTML tables and table headers // // Author: Nicola Asuni // // (c) Copyright: // Nicola Asuni // Tecnick.com LTD // www.tecnick.com // info@tecnick.com //============================================================+ /** * Creates an example PDF TEST document using TCPDF * @package com.tecnick.tcpdf * @abstract TCPDF - Example: HTML tables and table headers * @author Nicola Asuni * @since 2009-03-20 */ // Include the main TCPDF library (search for installation path). tcpdf(); $headingis="Import details"; // 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('Nicola Asuni'); $pdf->SetTitle(''.$headingis.''); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); // set default header data $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, "", 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('helvetica', 'B', 20); // add a page $pdf->AddPage(); $pdf->Write(0, '', '', 0, 'L', true, 0, false, false, 0); $pdf->SetFont('helvetica', '', 8); // ----------------------------------------------------------------------------- $counting=1; //my code start foreach($dispDATA as $fdata) { $tbl = '<table border="1" cellpadding="2" cellspacing="2" align="center"> <tr style="background-color:#578ebe"> <th colspan="6"><span>Import file No : '.$impfilenor.' </span><span> SUPPLIER : '.$fdata->name.'</span></th> </tr> <tr> <th colspan="2">CONSITMENT 2</th><th style="width:30%;" rowspan="4"></th><th>DATE OF BOOKING</th><th>'.$fdata->booking_date.'</th> </tr> <tr> <th>BLNO</th><th>'.$fdata->billLoadingNo.'</th><th>DATE OF PAYMENT</th><th>'.$fdata->PaymentDate.'</th> </tr> <tr> <th>BL/DATE</th><th>'.$fdata->billLoadingDate.'</th><th>GOODS RECIEVED DATE</th><th>'.$fdata->RecievedDate.'</th> </tr> <tr> <th>PORT</th><th>'.$fdata->port.'</th><th></th><th></th> </tr> <tr> <th colspan="4"></th><th></th> </tr> <tr> <th>SALES CONTRACT NO.</th><th></th><th colspan="2"></th><th></th> </tr> <tr> <th colspan="4">LICENCES : <div><span>Category</span> <span>License Number</span> <span>Recieved Quantity</span></div> </th><th></th> </tr> <tr> <th colspan="5"></th> </tr> <tr> <th>GOODS DISCRIPTION</th><th>NO OF BALES</th><th>QUANTITY BOOKED</th><th>QUANTITY RECEIVED</th><th>UNIT PRICE</th> </tr> <tr> <th>'.$fdata->quality.'('.$fdata->dinear.')'.'<b> Grade : </b> '.$fdata->grade.'</th><th>'.$fdata->box_no_of_bale.'</th><th>'.$fdata->quantity_booked.'</th><th><!--220 KGS--></th><th>'.$fdata->unit_price.'</th> </tr> <tr> <th colspan="5"></th> </tr> <tr> <th colspan="5"></th> </tr> <tr> <th colspan="4">FCN VALUE</th><th></th> </tr> <tr> <th colspan="4">TOTAL VALUE</th><th>'.$fdata->TotalValue.'</th> </tr> <tr> <th colspan="4">AVG RATE (KGS) INR</th><th>'.$fdata->AverageRate.'</th> </tr> </table><br>'; // output the HTML content //$pdf->writeHTML($htmlcontent, true, 0, true, 0); $pdf->writeHTML($tbl, true, false, false, false, ''); //my code end } // ----------------------------------------------------------------------------- //Close and output PDF document $pdf->Output(''.$headingis.'.pdf', 'I'); //============================================================+ // END OF FILE //============================================================+