Export to Excel 0s and 0.## formatted as string issue

Export to Excel 0s and 0.## formatted as string issue

ZeussZeuss Posts: 4Questions: 3Answers: 0
edited May 2017 in Free community support

I am using excelHTML5 to export datatable to Excel but the 0 and 0.## are exported as strings. All other numbers are exported as numbers but 0s and 0.00 or 0.58 etc are formated as string. I saw in a old thread that this issue was being discussed. Was it fixed in Buttons 1.3.1? I downloaded latest but still doesnt work.
here is the code.
{
extend: 'excelHtml5',
text: "Excel",
pageSize: 'LEGAL',
title: 'my title',
exportOptions: {
columns: ':visible',
orthogonal: 'export',
format: {
header: function ( data, columnIdx ) {
if(columnIdx==1 || columnIdx==2 || columnIdx==4)
return data+" ($)";
else if(columnIdx==3)
return data+" (%)";
else
return data;
}
}
}},
Is there a way I can fix this?
In Excel it shows error saying this cell is formated as string or has an apostrophe at the end.

Answers

  • allanallan Posts: 63,892Questions: 1Answers: 10,530 Site admin

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

    Allan

This discussion has been closed.