exporting html table to excel/word with conditions

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
enna
Forum Newbie
Posts: 8
Joined: Thu Jun 04, 2009 4:54 am

exporting html table to excel/word with conditions

Post by enna »

hi i need some help in exporting html table into an excel file..i found some scripts regarding that issue but it doesn't seem work the way i wanted it..the html table will retrieve data from database based on the choice of the user..i have this dropdown list wherein the user needs to choose something and then it will generate the html table..in short i need a script wherein it would like copy paste the html table into an excel/word file..the scripts i got only gives all the data in the database..thank you..
User avatar
akuji36
Forum Contributor
Posts: 190
Joined: Tue Oct 14, 2008 9:53 am
Location: Hartford, Connecticut

Re: exporting html table to excel/word with conditions

Post by akuji36 »

I found this note on another forum :

Excel can convert HTML tables by default. The easiest way to force it to do this is to save the HTML file with an XLS extension. Excel will then open the XLS as if it were its native workbook.
enna
Forum Newbie
Posts: 8
Joined: Thu Jun 04, 2009 4:54 am

Re: exporting html table to excel/word with conditions

Post by enna »

@akuji36

how is it possible??i mean how can i save it with a xls extension??i am not familiar with that kind..help..thank you
wpsd2006
Forum Commoner
Posts: 66
Joined: Wed Jan 07, 2009 12:43 am

Re: exporting html table to excel/word with conditions

Post by wpsd2006 »

search google for phpExcel
the have plenty function for php to excel, well it by pass the html thing
directly from database to php to excel
Post Reply