webpage to excel or csv

This is a discussion on "webpage to excel or csv" within the PHP Forum section. This forum, and the thread "webpage to excel or csv are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 8th, 2007, 20:42
bean_2k1's Avatar
SuperMember

SuperMember
Join Date: Oct 2005
Location: Walsall
Age: 23
Posts: 32
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via Skype™ to bean_2k1
webpage to excel or csv

Hi all

I'm currently working on a customer database at work where users can login in to this system and view all invoices and statement they have had with us. On one of my pages is display a table with every order they have placed with us, i want the user to be able to download that table content into csv or excel format. if this is possible


Thanks
Steven
Reply With Quote

  #2 (permalink)  
Old Dec 8th, 2007, 21:57
alexgeek's Avatar
Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,771
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: webpage to excel or csv

It would be better to use database.
you can query it and show the results.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #3 (permalink)  
Old Dec 9th, 2007, 11:49
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: webpage to excel or csv

This is actually something I haven't done. Here is how I'd get started, in case you don't get anything better:

Most SQL flavors will handle a csv-type export for you. (There are some advantages to a tab-delineated download for Excel, IIRC.)

So I guess my first approach would be to look at database functions. I've only done it with MySQL using phpMyAdmin, but logically, there must be a function sequence, which means you should be able to access it via a GET or POST request to the db. Since that would mean that the PHP is simple and the database function is more advanced, I'd ask this question in the appropriate db Forum.

As another possibility, you could format a query so that the result prints as a csv file, then let your user copy and paste it into a Notepad file and save it wherever he wanted. This would eliminate the hard part -- unless I'm missing something, you should be able to do this off the top of your head by simply structuring the PHP output, avoiding download management code -- but it wouldn't be nearly as slick. Again, it has been a while since I worked with this format, so it might need some instructions to the user about exactly how to save it; don't you use a *.csv extension and save as "All Files"?

Last edited by masonbarge; Dec 9th, 2007 at 11:52.
Reply With Quote
  #4 (permalink)  
Old Dec 9th, 2007, 12:09
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,639
Thanks: 0
Thanked 7 Times in 7 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: webpage to excel or csv

Surely for a CSV, you will need to use the implode() function to add commas to the data then just write that to the file?

After all, CSV stands for Comma Seperated Values.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone know much about Excel AdRock Webforumz Cafe 8 Sep 29th, 2007 19:58
Excel Thru Recovery Chase42304 Graphics and 3D 3 Nov 27th, 2006 14:21
Excel problem madhuri.t Classic ASP 1 Mar 7th, 2006 01:23
Excel to ASP... courtjester Classic ASP 14 Sep 27th, 2004 20:44


All times are GMT. The time now is 22:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43