Page 1 of 1

change the excel sheet property during export in php

Posted: Wed Nov 26, 2008 4:24 am
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

Re: change the excel sheet property during export in php

Posted: Wed Nov 26, 2008 11:29 am
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?

Re: change the excel sheet property during export in php

Posted: Fri Nov 28, 2008 4:19 am
by vipin0309
in csv format i am exporting

Re: change the excel sheet property during export in php

Posted: Fri Nov 28, 2008 4:31 am
by mintedjo
csv files can't be formatted

Re: change the excel sheet property during export in php

Posted: Fri Nov 28, 2008 5:40 am
by vipin0309
thanks mintedjo

is any other way to do this task

Re: change the excel sheet property during export in php

Posted: Fri Nov 28, 2008 5:51 am
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.

Re: change the excel sheet property during export in php

Posted: Fri Nov 28, 2008 5:54 am
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