Re: Re: Exporting HTML to Excel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Oct 13, 2004, at 10:40 AM, Gryffyn, Trevor wrote:

To all who've helped.

Thanks for your input. [embarrassment] Truthfully, when I gave that
example in my original email, I didn't try that specific one. But it
did work for me also when I attempted that one. [/embarrassment]

The reason I was getting a blank spreadsheet was b/c I was
only showing
specific columns based on whether certain $_SESSION variables
were set.
However, the page that's supposed to export to excel, I did
not include
my `session_start()`, so none of the variables were ever TRUE. Once I
saw that and fixed it, it worked like a charm!

But I have run across a small dilemma at this point. I cannot
open the
excel file using IE. However, I can through Mozilla and Safari. Guess
this is something else I have to look at and try to tackle!

Thanks again!
~Philip

<table>
    <tr>
        <td>Something</td>
        </td>Something else</td>
    </tr>
</table>


Btw: the example above has a </td> instead of a <td> on the second cell
so it puts the values in A1 and A2 instead of A1 and B1.

Yeah, I realized that also whenever all of my items were going in column A. But I fixed that.



Another note, I put a <td>=A1+B1</td> and it worked fine (put the formula in and it evaluates just fine that is).

Neeto feature!


Also, if you're having trouble in IE (I didn't, it worked fine) you might try changing the MIME type to something that'll download and give the option of save/open. There was another thread on this list about creating folders (not with PHP, but opening a file dialog so the user could create a folder for the download) that had a lot of good info about forcing the browser to open that dialog box.

What problem are you having in IE right now? Is it opening INSIDE IE as
an Excel sheet embedded or something (like PDFs do with Acrobat Reader)?
I had that happen once or twice while testing the code above.

Well, whenever I click on the link to export to excel (in IE), a "File Download" box pops up. It says the 'File name: toexcel.php' and the 'File type: ' (blank). It asks if I want to open or save. However, the File name should not be toexcel.php (that's the page), it should be 'project.xls'.


The error message I get whenever I try to Open or Save the file is: "IE cannot dowload toexcel.php from your.server.com. IE was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later." This is obviously not true b/c I can download from elsewhere.

Here's what I have included in the top of my file (just to reiterate):

header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="project.xls"');

I tried adding the `vnd.` to the content-type, thinking that IE might like that better, but it didn't. It works just the same though.


Anyway, good luck. Glad you figured out the session problem, that can be
frustrating.


-TG

Thanks. Any ideas? ~Philip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux