Reading excel table into PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • i.arda.tezcan@gmail.com

    Reading excel table into PHP

    Hello,

    I'm trying to make a web page that will read the xls file and make a
    table out of it on the web page. I want to change the excel file from
    time to time and I want the changes to be updated on the website
    dynamically. If it is possible to do it by writing a few lines of
    codes into the php file to make it read the data in the xls into the
    web page, how can it be done?

    If not, what would be the best way to do it?


    Arda~
  • Andy Dingley

    #2
    Re: Reading excel table into PHP

    On 5 Mar, 04:41, i.arda.tez...@g mail.com wrote:
    I'm trying to make a web page that will read the xls file and make a
    table out of it on the web page.
    If it is possible to do it by writing a few lines of
    codes into the php
    Easy way:

    * Use a Windows server

    * Install Excel (cost!) on this server

    * Write server-side web code that uses COM (M$oft technology, pretty
    easy) to access Excel as a COM component.

    ** Use Windows web scripting tools (IIS / JScript) to do this COM work
    (very easy)

    ** Use PHP and a COM bridge module to access COM work (not quite so
    easy)

    * Use the web scripting language to generate a HTML table.

    I would _NOT_ do this. It needs an Excel licence (expensive), it needs
    Excel installed in the back-end (security risk) and it needs Windows
    running on a server. However it is very easy to do, especially if
    you're already a M$oft shop.


    Allternatively I would write some VBA _within_ Excel to dump the XLS
    content out as XML (Maybe even as XHTML). I would run this Excel
    macro on my desktop, and it would upload the resulting file to a
    fileserver or ftp server that could be accessed by the web server
    (which could now be pure LAMP, with no Windows)

    If I wanted sophistication, the web server would then run an XSLT
    transform on this result, to make the page look exactly how I wanted
    it.


    I would also _NOT_ try to use any non-M$oft product that accessed
    Excel file formats directly. M$oft Office file formats are proprietary
    and unstable. Building tools that depend on them keeping the same
    format over time is just asking for trouble.

    Comment

    • Petr Vileta

      #3
      Re: Reading excel table into PHP

      i.arda.tezcan@g mail.com wrote:
      Hello,
      >
      I'm trying to make a web page that will read the xls file and make a
      table out of it on the web page. I want to change the excel file from
      time to time and I want the changes to be updated on the website
      dynamically. If it is possible to do it by writing a few lines of
      codes into the php file to make it read the data in the xls into the
      web page, how can it be done?
      >
      If not, what would be the best way to do it?
      >
      >
      Do not use PHP but Perl and module Spreadsheet::Pa rseExcel or other module
      from Spreadsheet family.


      --
      Petr Vileta, Czech republic
      (My server rejects all messages from Yahoo and Hotmail. Send me your
      mail from another non-spammer site please.)

      Please reply to <petr AT practisoft DOT cz>

      Comment

      Working...