Export mysql datas to Excelsheet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mageswar005
    New Member
    • Mar 2008
    • 72

    #1

    Export mysql datas to Excelsheet

    hi,
    I need one help, How can i Export the Datas from mysql to Excelsheet not csv in php coding.The excelsheet format should be comes under microsoft office excel spreadsheet format.i need all this should be in php.I already tried in google but that code has some problem in excelsheet format.

    thanks
    M.Mageswaran
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    PHP does not provide any functions that can handle Excel files.
    You can probably find classes that can handle them however. Try a Google search for Spreadsheet_Exc el_Reader. (See this thread for an idea how to use that)

    If it is at all possible, I would recommend saving the data as XML, which PHP can handle easily.

    Comment

    • dlite922
      Recognized Expert Top Contributor
      • Dec 2007
      • 1586

      #3
      Originally posted by mageswar005
      hi,
      I need one help, How can i Export the Datas from mysql to Excelsheet not csv in php coding.The excelsheet format should be comes under microsoft office excel spreadsheet format.i need all this should be in php.I already tried in google but that code has some problem in excelsheet format.

      thanks
      M.Mageswaran
      Your safest and reliable bet would be on CSV.

      A few reasons:

      CSV is automatically opened by Excel, you can manipulate the header with PHP so that windows doesn't open the file in the browser, but offers a Open/Save/Cancel dialogue to the user.

      When exporting data from MySQL, your data does not have *any* formatting (bold, color, margins, font, etc) for you to worry about anyway.

      If your user *does* actually change the formatting, upon save they are automatically prompted to save as a .xls file anyway.

      export to CSV code is cleaner, simpler, and therefore less buggy and more reliable. Could be alot faster than some solutions you might be heading towards.

      -Dan

      Comment

      Working...