8 Replies - 444 Views - Last Post: 23 April 2010 - 02:01 PM Rate Topic: -----

#1 Guest_Kay*


Reputation:

php to pdf

Posted 23 April 2010 - 08:38 AM

I'm wondering if anyone has any examples of how to make a pdf with my mysql data.

I was trying to use FPDF or TCPDF....and i can't find any examples that can work.

I want a table where:

- the row heights grow to suit the cell with the largest text
- the table header appears if a new page has to be created
- table is filled with data from my database but the query statement has variables in it like "SELECT * FROM $tableName
INNER JOIN category
ON $tableName.cat_id = category.cat_id"

Trying all the examples i have found....reading all their scripts...nothing works for me!

Please help

Is This A Good Question/Topic? 0

Replies To: php to pdf

#2 Crunch  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 139
  • View blog
  • Posts: 1,222
  • Joined: 28-July 09

Re: php to pdf

Posted 23 April 2010 - 09:10 AM

Try

http://www.google.co...l=&oq=&gs_rfai=

Cheer's
Was This Post Helpful? -1
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,222
  • Joined: 23-August 08

Re: php to pdf

Posted 23 April 2010 - 10:46 AM

You could output it to HTML how you want it and then use wkhtmltopdf to convert it.
Was This Post Helpful? 1
  • +
  • -

#4 Guest_Kay*


Reputation:

Re: php to pdf

Posted 23 April 2010 - 12:12 PM

The first way i tried to do it was with multicells....but then i came to the problem that i could make all the cells in a row match the height of the cell with the most text...no math i try will help fix it...because that pdf is pretty much perfect otherwise.


I've tried doing with writeHTML making a table but it won't let me put in the php stuff so that the row will repeat so i can add all the data. I can't find any examples on how you are suppose to write it.

So I can't seems to find anyway to do it....and any examples of people grabbing from mysql that I find...are just single rows of text.

I've searched many of their forums back like 100 pages....i've search the internet....i've tried examples...tried to play around...i just can't seem to make it work :(
Was This Post Helpful? 0

#5 Guest_Kay*


Reputation:

Re: php to pdf

Posted 23 April 2010 - 12:14 PM

sorry meant to write "came to the problem that i COULD NOT make all the cells"
Was This Post Helpful? 0

#6 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,222
  • Joined: 23-August 08

Re: php to pdf

Posted 23 April 2010 - 01:00 PM

What does this

Quote

So I can't seems to find anyway to do it....and any examples of people grabbing from mysql that I find...are just single rows of text.

mean exactly?
Was This Post Helpful? 0
  • +
  • -

#7 Guest_Kay*


Reputation:

Re: php to pdf

Posted 23 April 2010 - 01:21 PM

http://www.fpdf.org/en/script/ex14.pdf

For example this....shows you how to grab your data from database and output it into a table....however their data is like one word or two....mine can have a blurb of text say like 300 characters....if i use that example mine text will just run over other cells instead of the row height growing to accommodate my cell with the large amount of text
Was This Post Helpful? 0

#8 Arenlor  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 34
  • View blog
  • Posts: 389
  • Joined: 26-April 06

Re: php to pdf

Posted 23 April 2010 - 01:22 PM

May I suggest mysql_fetch_row()? http://us2.php.net/m...h-row.php#96312
Was This Post Helpful? 1
  • +
  • -

#9 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,222
  • Joined: 23-August 08

Re: php to pdf

Posted 23 April 2010 - 02:01 PM

If you are able to create an HTML table that looks the way you want it, then I would really suggest going the route I suggested with wkhtmltopdf. It will save you a lot of headaches. As someone who has recently done some work with PDF -- although not with PHP -- it is a giant pain.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1