How to php export to excel

Reply

Join Date: Mar 2008
Posts: 15
Reputation: csshacker is an unknown quantity at this point 
Solved Threads: 1
csshacker's Avatar
csshacker csshacker is offline Offline
Newbie Poster

How to php export to excel

 
0
  #1
May 15th, 2008
How to php export to excel
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 252
Reputation: ProfessorPC is an unknown quantity at this point 
Solved Threads: 27
ProfessorPC ProfessorPC is offline Offline
Posting Whiz in Training

Re: How to php export to excel

 
0
  #2
May 15th, 2008
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,761
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: How to php export to excel

 
0
  #3
May 15th, 2008
  1. <?php
  2. $filename ="excelreport.xls";
  3. $contents = "testdata1 \t testdata2 \t testdata3 \t \n";
  4. header('Content-type: application/ms-excel');
  5. header('Content-Disposition: attachment; filename='.$filename);
  6. echo $contents;
  7. ?>

This is the simplest way to generate an excel report.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 4
Reputation: jana36 is an unknown quantity at this point 
Solved Threads: 1
jana36 jana36 is offline Offline
Newbie Poster

Re: How to php export to excel

 
0
  #4
May 16th, 2008
hi, i am janardhan..
i want some more coding details about export to excell sheet.. suppose i am retriving data from database and storing the values in a table. i want to export in an excell sheet with proper header ..how can i develop this.?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,761
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: How to php export to excel

 
0
  #5
May 16th, 2008
Replace testdata in the above example with the database values.
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 1
Reputation: amakrid is an unknown quantity at this point 
Solved Threads: 0
amakrid amakrid is offline Offline
Newbie Poster

Re: How to php export to excel

 
0
  #6
Jul 1st, 2009
Can I change the color of contents ?
e.g testdata1 ---> blue
testdata2 ---> red
etc ...

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Dec 2009
Posts: 1
Reputation: timmuin is an unknown quantity at this point 
Solved Threads: 0
timmuin timmuin is offline Offline
Newbie Poster

need help

 
0
  #7
19 Days Ago
Originally Posted by nav33n View Post
  1. <?php
  2. $filename ="excelreport.xls";
  3. $contents = "testdata1 \t testdata2 \t testdata3 \t \n";
  4. header('Content-type: application/ms-excel');
  5. header('Content-Disposition: attachment; filename='.$filename);
  6. echo $contents;
  7. ?>

This is the simplest way to generate an excel report.
Hi,
Let me confess, I am ZERO in php.
I purchased one cd which has php files embedded with html page then scrolling pages in php formate withen windows of html .
Main data in in php file .
How to get this data in office document formate ( either MS Word or MS Excel)? Can some one help me in doing so....I am fed up.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 883
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 142
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark
 
0
  #8
19 Days Ago
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Reply

Message:




Views: 16182 | Replies: 7
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC