change the excel sheet property during export in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vipin0309
Forum Newbie
Posts: 5
Joined: Sat Nov 15, 2008 7:42 am

change the excel sheet property during export in php

Post by vipin0309 »

how we change the excel sheet property during the exporting.Ex change the coloumn color and print the leading zero in any colum.

please help me
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: change the excel sheet property during export in php

Post by Mark Baker »

vipin0309 wrote:how we change the excel sheet property during the exporting.Ex change the coloumn color and print the leading zero in any colum.
How are you exporting the excel sheet?
vipin0309
Forum Newbie
Posts: 5
Joined: Sat Nov 15, 2008 7:42 am

Re: change the excel sheet property during export in php

Post by vipin0309 »

in csv format i am exporting
mintedjo
Forum Contributor
Posts: 153
Joined: Wed Nov 19, 2008 6:23 am

Re: change the excel sheet property during export in php

Post by mintedjo »

csv files can't be formatted
vipin0309
Forum Newbie
Posts: 5
Joined: Sat Nov 15, 2008 7:42 am

Re: change the excel sheet property during export in php

Post by vipin0309 »

thanks mintedjo

is any other way to do this task
mintedjo
Forum Contributor
Posts: 153
Joined: Wed Nov 19, 2008 6:23 am

Re: change the excel sheet property during export in php

Post by mintedjo »

Funnily enough...
I dont know. I've recently been looking into this myself for exporting HTML tables into Excel and keeping the formatting.

I found a pear package that looks like it might have some useful stuff but its a few years old and seems to have been abandoned.
If you want to look then heres the link
http://pear.php.net/package/Spreadsheet_Excel_Writer

I decided to export the data as an XML file in the MS Excel 2003 XML SpreadSheet format.
In my opinion its not a perfect solution but you can control the format of the data if you use this.
Here's a link to a short tutorial on generating the files.
http://www.ibm.com/developerworks/xml/l ... index.html
It doesn't contain much stuff about styles and formatting but you should be able to work out most of the styling stuff yourself.

If you choose to use the XMLSS format please let me know how you get on. I'd like to know how you generate the styles as I'm pretty sure my approach is the worst possible way to go about doing it :-P.
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: change the excel sheet property during export in php

Post by Mark Baker »

mintedjo wrote:I found a pear package that looks like it might have some useful stuff but its a few years old and seems to have been abandoned.
Alternatively, look at my sig
Post Reply