User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 375,207 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,318 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 399 | Replies: 4
Reply
Join Date: Mar 2008
Posts: 15
Reputation: csshacker is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
csshacker's Avatar
csshacker csshacker is offline Offline
Banned

How to php export to excel

  #1  
May 15th, 2008
How to php export to excel
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Location: Oklahoma
Posts: 159
Reputation: ProfessorPC is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 16
ProfessorPC ProfessorPC is online now Online
Junior Poster

Re: How to php export to excel

  #2  
May 15th, 2008
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,057
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 229
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How to php export to excel

  #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.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

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

Re: How to php export to excel

  #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  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,057
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 229
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How to php export to excel

  #5  
May 16th, 2008
Replace testdata in the above example with the database values.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 2:50 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC