Export to excel is exporting 0% to blank in excel file

Export to excel is exporting 0% to blank in excel file

anujeetanujeet 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

Answers

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    Answer ✓

    Happy to take a look at a test case showing the issue.

    Allan

  • anujeetanujeet Posts: 39Questions: 15Answers: 0

    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

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394

    "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?

  • anujeetanujeet Posts: 39Questions: 15Answers: 0
    edited May 2017

    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

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    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

  • anujeetanujeet Posts: 39Questions: 15Answers: 0
    edited May 2017

    Hi @allan ,

    Could you please let us know about the time to resolve the issue?

    Thanks

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    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

  • ctuong2410ctuong2410 Posts: 1Questions: 0Answers: 0

    @anujeet
    Please put 0% into <span> tag. <span>0%</span>
    Tuong

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    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

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    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

  • geethunimeshgeethunimesh Posts: 25Questions: 9Answers: 0

    a quick fix can be adding a space before "%". Like "0 %".

This discussion has been closed.