| | |
php table export excel worksheet decimal places problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Hi -
Can someone please help me?
I have a html table generated by php mysql and have a header to download it to excel.
My problem is, I have this cell/table data that displays .10 in html and when I exported it in excel it displays as 0.1. The proper output should be the ones displayed in html table, and they don't allow me to add a single quote or anything to change the value to string.
Is there anyway special php formatting I need to know before downloading it to excel?
Can anyone guide me on these please?
Thanks,
Pabz
Can someone please help me?
I have a html table generated by php mysql and have a header to download it to excel.
My problem is, I have this cell/table data that displays .10 in html and when I exported it in excel it displays as 0.1. The proper output should be the ones displayed in html table, and they don't allow me to add a single quote or anything to change the value to string.
Is there anyway special php formatting I need to know before downloading it to excel?
Can anyone guide me on these please?
Thanks,
Pabz
Hi there,
in HTML apply this
to cells with your . values or define a CSS class with this style and apply the class.
in HTML apply this
html Syntax (Toggle Plain Text)
style="mso-number-format:'\@';"
Last edited by petr.pavel; Sep 4th, 2008 at 5:10 am. Reason: better wording
Petr 'PePa' Pavel
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
Thanks for the reply petr.pavel.
I tried the style that you suggested and it added a single quote before the value. I ask them about this before and they prefer if theres no extra character shown.
Late yesterday, a co worker of mine gave me a link ...http://www.akbkhome.com/blog.php/Vie...cel_again.html. XML to excel is one of the solution but for a quicker way we can use PEAR spreadsheet excel writer..http://pear.php.net/manual/en/packag...cel-writer.php.
Hope this one could help someone else..thanks
I tried the style that you suggested and it added a single quote before the value. I ask them about this before and they prefer if theres no extra character shown.
Late yesterday, a co worker of mine gave me a link ...http://www.akbkhome.com/blog.php/Vie...cel_again.html. XML to excel is one of the solution but for a quicker way we can use PEAR spreadsheet excel writer..http://pear.php.net/manual/en/packag...cel-writer.php.
Hope this one could help someone else..thanks
•
•
•
•
I tried the style that you suggested and it added a single quote before the value.
Can you give me an URL with the HTML table you're trying to import? Or can you attach it here?
Petr
Petr 'PePa' Pavel
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Looping through the first row of a 2 dimensional array
- Next Thread: URL Variables PHP4 to PHP5
| Thread Tools | Search this Thread |
.htaccess ajax apache api array back basic beginner binary broken cakephp checkbox class cms code computing cron curl customizableitems database date delete display dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validation validator variable video web xml youtube





