Jump to content


Photo

Export to Excel


  • Please log in to reply
6 replies to this topic

#1 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 15 September 2006 - 10:21 PM

Hey guys

I have a challenge in front of me

I am creating a script, which allows the user to add sales of products, add stock to DB bla bla bla

But what they want is a way to export the results into a (sorry in advanced) Micro N Soft Excel Spreadhseet (I did say sorry)

Any suggestions on writing Excel Spreadhseets in PHP
Tell me the problem, I will try tell you the solution

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 15 September 2006 - 10:24 PM

Easiest way is to create a CSV file which Excel will open just by double-clicking on the file icon.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 gijew

gijew
  • Members
  • PipPipPip
  • Advanced Member
  • 240 posts
  • LocationCalifornia

Posted 15 September 2006 - 10:42 PM

frwrite() and save as .csv file.  If you need a header just store in a variable and prepend to the loop of your results.  It's just a few lines of code.
I'm considered good looking in some countries

#4 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 15 September 2006 - 10:48 PM

Can u add Cell Formatting into Comma Seperated Value Sheets?

Tell me the problem, I will try tell you the solution

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 15 September 2006 - 10:56 PM

No
Legend has it that reading the manual never killed anyone.
My site

#6 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 15 September 2006 - 10:59 PM

For that you need COM.

Try googling "php com excel"

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#7 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 16 September 2006 - 07:54 AM

Thankx I will look into COMS
(And I didn't think I could add cell formatting in CVS, thats why I called it comma Seperated values)
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users