RE: Excel - merging cells with PHP

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

 



You can also do a "Click here to download", send it headers identifying
the the page being loaded as something like "application/Excel" or
whatever the mime type is and pass it HTML.  Excel will interpret it and
load the data into cells.

That gets around the whole COM thing.

If you do that, then doing a rowspan or colspan should "merge" cells:


<tr>
<td colspan=2>Some merged data in col1 and col2</td>
<td>Column 1</td><td>Column 2</td>
</tr>


Also, I've run into problems with HTML in Excel sometimes using <br>'s
or something where I didn't use a colspan or rowspan and it put things
into new cells.  I think it was with <br>'s at least.  It was an
annoyance to me but you might use that to your advantage.

With COM, you'd select a range then use the "Merge" method.

In VBA, it's:

Range("A1:A4").Merge

I'm rusty on my PHP COM + Excel stuff.

Or you can just look into the PEAR stuff that Martin recommended
(probably your best bet).  :)

-TG

> -----Original Message-----
> From: Bastien Koert [mailto:bastien_k@xxxxxxxxxxx] 
> Sent: Monday, November 29, 2004 10:24 AM
> To: Matthew.Perry@xxxxxxxxxxxx; php-db@xxxxxxxxxxxxx
> Subject: RE:  Excel - merging cells with PHP
> 
> 
> You would need to access the XL sheet via the COM interface 
> (don't know how 
> are doing currently) and then work out the macros or commands 
> to pass to the 
> XL sheet to have it do the things you need.
> 
> Bastien
> 
> >From: "Perry, Matthew (Fire Marshal's Office)" 
> <Matthew.Perry@xxxxxxxxxxxx>
> >To: php-db@xxxxxxxxxxxxx
> >Subject:  Excel - merging cells with PHP
> >Date: Mon, 29 Nov 2004 08:48:52 -0600
> >
> >When you export a table to excel, is there a way to merge 
> cells and create
> >borders?  I want my excel file to look exactly like my html 
> table looks.
> >
> >
> >
> >Matthew Perry

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



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux