strange i just worked this out over the weekend.

I'm going to be use it to email data that will be inserted 
into an excel sheet you just tell it the html file is a xls file 
in the mime headers and it opens the file up in excel, 
no problem and no messing with csv files, comas,
xml support and all that.

ie
Content-Type: application/vnd.ms-excel;
 name="test.xls" 
Content-Transfer-Encoding: base64
Content-Disposition: attachment; 
 filename="test.xls";

if it's excel 2002 (xp) you can use styles and edit the doc properties.
have a look for <x:DisplayGridlines/> or <x:DoNotDisplayGridlines/>
in the file. If it's 97 then you need the border=1 in the table though.

have fun.

Paul Roberts
[EMAIL PROTECTED]
++++++++++++++++++++++++
----- Original Message ----- 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 06, 2002 3:25 PM
Subject: RE: [PHP] Formatting Information in header? Gridlines in Excel


> [snip]
> This is intriguing me, are you opening up excel in a browser window or just
> printing out html tables?? I am confused.
> [/snip]
> 
> I am using PHP to query a database and create an HTML table based on the
> information in the database (in this case it it a large crosstab query).
> This is set up to open Excel in a broswer window (inline) and display the
> data in a worksheet. All normal Excel functions can be performed on the
> worksheet without changing the data in the database. These worksheets then
> can be saved to the user's local disk. They can always run the original
> query again by requesting the worksheet/page again.
> 
> Link pointed to php page that will send to browser <a
> href="test.php/test.xls"> Stupid IE trick, the .xls file does not 'exist',
> but will fake out Excel to open the .php 'page' in a worksheet. Also, make
> sure to include header information listed in previous e-mail at the top of
> the PHP page.
> 
> The steps are;
> 1. Create a PHP file with the header info
> 2. Do a PHP request to the database.
> 3. Use the results to create an HTML table within the PHP
> 4. Open this table in a spreadsheet
> 
> HTH!
> 
> Jay Blanchard
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 



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

Reply via email to