Export to excel is exporting 0% to blank in excel file
Export to excel is exporting 0% to blank in excel file
anujeet
Posts: 39Questions: 15Answers: 0
Hi Team,
We are using data-table export to excel functionality. We have a column in data-table list where value can be 0% but while exporting to excel value 0% is exporting as empty value in excel. Do you have any solution for this?,
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Happy to take a look at a test case showing the issue.
Allan
Hi Allan,
Thanks for your reply.
I have created below example for you.
https://jsfiddle.net/Akashs/bjvf8q3a/17/
On above page, you can click on "Excel" link to check the exported file. Looking forward your early reply.
Thanks
"0%" is a string, not an integer. Presumably Excel interprets it as an empty string.
As your column is headed "Percentage" do you really need the "%" in your data?
Hi Tangerine,
The link I shared is a example with column title "Marks Percentage". In our application the column title is "Vat" so under this column we are showing 0% or 15% etc. Is there way to export "0%" as well?
Thanks
Thanks for the example. That, I'm afraid to say, is a bug.
0
itself probably suffers from the same issue.I'll post back here once I've committed a fix.
Allan
Hi @allan ,
Could you please let us know about the time to resolve the issue?
Thanks
I don't currently have one. I'll look into it as soon as I can. Priority support is available if you want me to prioritise it over other things.
Allan
@anujeet
Please put 0% into <span> tag. <span>0%</span>
Tuong
That shouldn't actually make any difference I'm afraid since Buttons' export will strip the HTML before it does the special XLSX formatting.
Allan
I've just committed the required fix.
The nightly will update shortly with the fix and it will be in the next release version.
Thanks,
Allan
a quick fix can be adding a space before "%". Like "0 %".