473,396 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Not all database table cells in FPDF showing

1
Hello,
Pls help me with this.
I want to output data from database(mySql).Output them in pdf form using FPDF (like a report). My problem is that, Not all the data from the db are being outputted. Just a first(5 cells) is showing. I dont know how to fix this anymore. pls help me..am just a newbie.
Here is my code....
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. require('fpdf.php');
  4.  
  5. class PDFz extends FPDF
  6. {
  7. function Header()
  8. {
  9.     global $title;
  10.     $this->Image('logo.jpg',10,20,33,0,'','http://www.websolutionnetwork.com/');    
  11.     $this->SetFont('Arial', 'B', 20);
  12.     $this->SetFillColor(36, 96, 84);
  13.     $this->SetTextColor(28,134,238);
  14.     $this->Cell(0, 10, "", 0, 1, 'C', false);
  15.     $this->Cell(0, 5, "", 0, 1, 'C', false);
  16.     $this->SetFont('Arial','',18);
  17.     $this->Cell(0,6,'Web Solution Network Client Detail',0,1,'C');
  18.     $this->SetFont('Arial','',9);
  19.     $this->Cell(150,10,'DATE: '.date('d-m-y'),0,1,'L');
  20.     $this->SetAuthor(0,6,'Gurjit Singh',0,1,'C');
  21.     $this->Ln(10);
  22.     //Ensure table header is output
  23.     parent::Header();
  24. }
  25. // Page footer
  26. function Footer()
  27. {
  28.     // Position at 1.5 cm from bottom
  29.     $this->SetY(-15);
  30.     // Arial italic 8
  31.     $this->SetFont('Arial','I',8);
  32.     // Page number
  33.     $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
  34. }
  35.  
  36. }
  37. $pdf = new PDFz();
  38. $pdf->AddPage();
  39. $pdf->SetFont('Arial','B',16);
  40.  
  41. $pdf->Cell(40,6,'No:',1,0,'C');
  42. $pdf->Cell(40,6,'Client Name',1,0,'C');
  43. $pdf->Cell(40,6,'Place',1,0,'C');
  44. $pdf->Cell(40,6,'Id Person',1,0,'C');
  45. $pdf->Cell(40,6,'On/Off/dispute',1,0,'C');
  46. $pdf->Cell(40,6,'Paid/Panding',1,0,'C');
  47. $pdf->Cell(40,6,'Star',1,0,'C');
  48. $pdf->Cell(40,6,'Comment',1,0,'C');
  49. $pdf->Cell(40,6,'Month',1,0,'C');
  50. $pdf->Cell(40,6,'Total Payment',1,0,'C');
  51. $pdf->Cell(40,6,'Cut fee',1,0,'C');
  52. $pdf->Cell(40,6,'Rupees',1,0,'C');
  53. $pdf->Cell(40,6,'Client Email',1,0,'C');
  54. $pdf->Cell(40,6,'Client Skype',1,0,'C');
  55. $pdf->ln();
  56.  
  57. $mysqli = new mysqli("localhost", "root", "", "account");
  58. if ($mysqli->connect_errno) {
  59.     echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
  60. }
  61.  
  62. $pdf->SetFont('Arial','',12);
  63. $query = $mysqli->query("SELECT * FROM client_entry ORDER BY 1 DESC");
  64. while($row = $query->fetch_array(MYSQLI_ASSOC)){
  65.     $pdf->Cell(40,6,$row['client_id'],1,0,'C');
  66.     $pdf->Cell(40,6,$row['client_name'],1,0,'L');
  67.     $pdf->Cell(40,6,$row['dev_place'],1,0,'L');
  68.     $pdf->Cell(40,6,$row['dev_name'],1,0,'L');
  69.     $pdf->Cell(40,6,$row['client_status'],1,0,'L');
  70.     $pdf->Cell(40,6,$row['client_payment'],1,0,'L');
  71.     $pdf->Cell(40,6,$row['client_star'],1,0,'L');
  72.     $pdf->Cell(40,6,$row['client_comment'],1,0,'L');
  73.     $pdf->Cell(40,6,$row['entry_month'],1,0,'L');
  74.     $pdf->Cell(40,6,$row['total_payment'],1,0,'L');
  75.     $pdf->Cell(40,6,$row['cut_fee'],1,0,'L');
  76.     $pdf->Cell(40,6,$row['total_rupees'],1,0,'L');
  77.     $pdf->Cell(40,6,$row['client_email'],1,0,'L');
  78.     $pdf->Cell(40,6,$row['client_skype'],1,0,'L');
  79.     $pdf->ln();
  80. }
  81.  
  82.  
  83. $pdf->Output();
  84. ?>
Nov 10 '15 #1
0 1006

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Finn Newick | last post by:
By defining a style as follows: @media aural, handheld {td.layout {display:block;}} I'm hoping to linearise layout tables when viewed by screenreaders and handheld devices (it is also be in...
3
by: Jaz | last post by:
Is there a reason why IE wont apply styles on table cells? Either I shouldn't do this, I've got an error somewhere, or IE has a bug or doesn't support it. (Opera and Moz render okay) Since I've...
1
by: Mark Carroll | last post by:
I can't get my table cells to not have a gap between them in IE. For example, with IE6SP1 I get a gap between the two red squares on http://www.chiark.greenend.org.uk/~markc/test/test.html instead...
4
by: N. Demos | last post by:
The following code renders as intended in IE (A TABLE, with cells of fixed width and height, inside of a DIV with fixed width and height and overflow set to hidden.) In Firefox, the table cells...
0
by: N. Demos | last post by:
I have a single row table with fixed dimensioned cells nested inside a fixed dimensioned div, which has overflow: hidden. The div's dimensions are such that It should only display the first two...
3
by: N. Demos | last post by:
I have a single row table with fixed dimensioned cells nested inside a fixed dimensioned div, which has overflow: hidden. The div's dimensions are such that It should only display the first two...
5
by: Richard Dixson | last post by:
I created a new C# web application. Basically all I am trying to do is create a table that consists of a few rows with two columns in each. And then to set those columns to text values from my...
2
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the...
5
by: Gwenne Moses | last post by:
Hello there, Pls help me with this. I want to output data from database(mySql).Output them in pdf form using FPDF (like a report). My problem is that, Not all the data from the db are being...
0
by: sreedharmcts | last post by:
I have Bulk data ,just want to insert that data from Gridview to Database table how it possible? I have done this way is it correct? protected void btn_insert_Click(object sender, EventArgs e) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.