Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Linuxmania Linuxmania is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 392
Rep Power: 14
Linuxmania mempunyai hidup yang Normal
Default FPDF Table dengan multipage

agan2 yang ganteng.



Ane selalu mengalami error pas buat page baru pada fpdf.



ni kodenya




PHP Code:




$headerText = array('No.','Text');

$columns = count($headerText);



$pdf = new fpdf_table;



$no = 0;



foreach(
$items as $item){



if(
$no == 20){

$no = 0;

}



if(
$no == 0){

$pdf->AddPage();

//Table Header

for($i=0; $itbSetHeaderType($aSimpleHeader);



//Draw the Header

$pdf->tbDrawHeader();

}

$no++;

// No. Urut

$data[0]['TEXT'] = $no;

$data[0]['T_ALIGN'] = "C";//default in the example is C



// Nama Barang

$data[1]['TEXT'] = "Text ".$no;

$data[1]['T_ALIGN'] = "L";



$pdf->tbDrawData($data);

}



//output the table data to the pdf

$pdf->tbOuputData();



//draw the Table Border

$pdf->tbDrawBorder();



$pdf->output("test.pdf","I");







Jadi pas 20 item, langsung membuat halaman baru.

tapi Tablenya hanya kebentuk pas halaman berikutnya, pada halaman pertama table tersebut hilang.



Please..



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 02:45 PM.


no new posts