how to limit the number of datas in pdf
Posted
by udaya
on Stack Overflow
See other posts from Stack Overflow
or by udaya
Published on 2010-03-30T12:10:14Z
Indexed on
2010/03/30
12:13 UTC
Read the original article
Hit count: 395
php
|codeigniter
Hi I am exporting data from php page to word,, there i get 'n' number of datas in each page .... How to set the maximum number of data that a word page can contain ,,,, I want only 20 datas in a single page
This is the coding i use to export the data to pdf
In mysql_table.php the table for the pdf document is be generated
<?php
require('mysql_table.php');
class PDF extends PDF_MySQL_Table
{
function Header()
{
//Title
$this->SetFont('Arial','',18);
$this->Cell(0,6,'Country details',0,1,'C');
$this->Ln(10);
parent::Header();
}
}
//Connect to database
mysql_connect('localhost','root','');
mysql_select_db('cms');
$pdf=new PDF();
$pdf->AddPage();
//First table: put all columns automatically
$pdf->Table("SELECT
(SELECT COUNT(*) FROM tblentercountry t2 WHERE t2.dbName <= t1.dbName and dbIsDelete='0')
AS SLNO ,dbName as Namee,t3.dbCountry as Country,t4.dbState as State,t5.dbTown as Town
FROM tblentercountry t1
join tablecountry as t3,
tablestate as t4,
tabletown as t5
where t1.dbIsDelete='0'
and t1.dbCountryId=t3.dbCountryId
and t1.dbStateId=t4.dbStateId
and t1.dbTownId=t5.dbTownId
order by dbName");
$pdf->AddPage();
//Second table: specify 3 columns
$pdf->AddCol('rank',20,'','C');
$pdf->AddCol('name',20,'tablecountry');
$pdf->AddCol('pop',20,'Pop (2001)','R');
$prop=array('HeaderColor'=>array(255,150,100),
'color1'=>array(210,245,255),
'color2'=>array(255,255,210),
'padding'=>2);
//$pdf->Table('select dbCountry,dbCountryId from tablecountry limit 0,10',$prop);
$pdf->Output();
?>
How to limit the number of datas in a page
© Stack Overflow or respective owner