Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2366

Large numbers exported to Excel

$
0
0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: I had an issue when exporting data table content to Excel where a column had 15+ character strings comprised of numbers only. Excel would display the column data in scientific notation.

I searched and found This solution that worked just fine.

$('#example').DataTable({
  dom: 'Bfrtip',
  buttons: [{
    extend: 'excelHtml5',
    title: 'Transaction',
    customizeData: function(data) {
      for(var i = 0; i < data.body.length; i++) {
        for(var j = 0; j < data.body[i].length; j++) {
          data.body[i][j] = '\u200C' + data.body[i][j];
        }
      }
    },      
    orientation: 'landscape'
  }]
});

Then today I searched for a value from that column that I know exists in Excel file and it couldn't find it. I am pretty sure it is due to ZWNJ character. So, back to square one!

Is there any remedy for this?


Viewing all articles
Browse latest Browse all 2366

Trending Articles