Exporting to Excel 2003

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bobkaku

    #1

    Exporting to Excel 2003

    I had a PHP script that used to successfully output to Excel 2000. I
    used the header statements
    header ('Content-type: application/vnd.ms-excel');
    header ('Content-disposition: inline; filename=output .htm');

    Last year I upgraded to Excel 2003, and now the output is just a table
    that shows up in the browser.

    Does anybody know what might be problem?

    Thanks in advance.

  • Michael Vilain

    #2
    Re: Exporting to Excel 2003

    In article <1126970803.337 223.35680@z14g2 000cwz.googlegr oups.com>,
    "bobkaku" <bobkaku@yahoo. com> wrote:
    [color=blue]
    > I had a PHP script that used to successfully output to Excel 2000. I
    > used the header statements
    > header ('Content-type: application/vnd.ms-excel');
    > header ('Content-disposition: inline; filename=output .htm');
    >
    > Last year I upgraded to Excel 2003, and now the output is just a table
    > that shows up in the browser.
    >
    > Does anybody know what might be problem?
    >
    > Thanks in advance.[/color]

    change the name of the file to output.xls

    The browser is interpreting the file extension as a HTML file. You want
    it to interpret it as an excel file. It all depends on how you have
    your MIME types setup. Don't know your OS or browser config but try
    this.

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    Comment

    • Oli Filth

      #3
      Re: Exporting to Excel 2003

      Michael Vilain said the following on 17/09/2005 19:27:[color=blue]
      > In article <1126970803.337 223.35680@z14g2 000cwz.googlegr oups.com>,
      > "bobkaku" <bobkaku@yahoo. com> wrote:
      >
      >[color=green]
      >>I had a PHP script that used to successfully output to Excel 2000. I
      >>used the header statements
      >> header ('Content-type: application/vnd.ms-excel');
      >> header ('Content-disposition: inline; filename=output .htm');
      >>
      >>Last year I upgraded to Excel 2003, and now the output is just a table
      >>that shows up in the browser.
      >>
      >>Does anybody know what might be problem?
      >>
      >>Thanks in advance.[/color]
      >
      >
      > change the name of the file to output.xls
      >[/color]

      The file-name is irrelevant assuming you are sending the correct MIME-type.

      Try "Content-disposition: attachment" instead.



      --
      Oli

      Comment

      Working...