For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > November 2004 > RE: [PHP-DB] Excel - merging cells with PHP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Excel - merging cells with PHP
Trevor Gryffyn

2004-11-29, 3:59 pm

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=3D2>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
[color=darkred]
> -----Original Message-----
> From: Bastien Koert [mailto:bastien_k@hotmail.com]=20
> Sent: Monday, November 29, 2004 10:24 AM
> To: Matthew.Perry@fmo.hctx.net; php-db@lists.php.net
> Subject: RE: [PHP-DB] Excel - merging cells with PHP
>=20
>=20
> You would need to access the XL sheet via the COM interface=20
> (don't know how=20
> are doing currently) and then work out the macros or commands=20
> to pass to the=20
> XL sheet to have it do the things you need.
>=20
> Bastien
>=20
> <Matthew.Perry@fmo.hctx.net>
> cells and create
> table looks.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com