| | |
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 |
5.2.10 action apache api array beginner beneath binary broken cakephp checkbox class classes cms code cron curl database date destroy display dynamic echo echo$_get[x]changingitintovariable... email encode error fcc file files folder form forms function functions google header howtowriteathesis href htaccess html image images include insert ip javascript joomla limit link local login mail memberships menu mlm mod_rewrite multiple multipletables mysql mysqlquery neutrality oop open passwords paypal pdf php provider query radio random record remote rss script search server sessions sockets source space sql strip_tags syntax system table template thesishelp tutorial update upload url validator variable video voteup web window.onbeforeunload=closeme; youtube





