Number detection in excelHTML5
Number detection in excelHTML5
serio72
Posts: 3Questions: 1Answers: 0
Hi guys,
I live in Italy and as you know here we use dot as thousand separator and comma for decimals.
Exporting datatables using excelHTML5 is making me crazy for number less than 1 thousand.
There is a way to disable number detection in button script? It may be usefull for me to have numbers as strings
Many thanks
Sergio
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Very good point.
I'm afraid that at the moment there is no way to disable externally. You'd need to modify Buttons a little bit - make this array empty and it won't do any special formatting.
Another option would be to use orthogonal export data and have the data requested for export return with a dot for the decimal place.
This is something I will look into improving. Thanks for pointing it out.
Allan
Sergio,
same in that other country north of the alps ... This is my solution for Excel depending on the language. The key is that you format the numbers the English way without 1,000 separators and with decimal point. Then let the local Excel installation decide which way to format it for the end user. You would also tell Excel which columns to format with 1,000 separators. Then it works regardless of the local Excel installation. The code below also removes other text from the column, but requires to know which way the input data is formatted, either the Italian or the English way (but it doesn't matter whether input data has 1,000 separator or not).
For example if your input column is set to: 1.000,99 Euro and the language is Italian ('it') the result is 1000.99 which is subsequently formatted in Excel as
a) English Excel installation: 1,000.99 (or 1000.99 if you don't set the column attr below)
b) Italian Excel installation: 1.000,99 (or 1000,99 without attr( 's', '64' );)
This also works for numbers less than 1,000. In that case Excle would receive a value of 999.99 for example and format this as 999,99 (Italian) and 999.99 (English).
Many Thanks guys!
Tomorrow I'll try rf1234 solution
I'm trying a more complex solution: export datatable as csv and send it to a servlet. This one make report using jasperreports libraries and sends back to caller...
I know it seems I'm a little crazy, but I'm new in jquery world...
Hi,
I have the same problem. I try to give a contribute.
I found out that the output of the extend copyHtml5 pasted into Excel running with Italian settings is perfect. I hope that this could help allan to address the issue.
Regards,
Antonio