ExcelHtml5 export - setting title to null causes Excel to repair file
ExcelHtml5 export - setting title to null causes Excel to repair file
Hi,
I'm facing an issue with the Excel export that causes Excel to repair the file.
In my Excel, I don't want the title line to appear.
I use the following setting for my button:
buttons: ['copyHtml5', {
extend: 'excelHtml5',
text: 'Sauver en tant que fichier Excel',
filename: function() {
var date_edition = moment().format("YYYY-MM-DD HH[h]mm")
var selected_machine_name = $("#output_select_machine select option:selected").text()
return date_edition + ' - ' + selected_machine_name
},
sheetName: 'Output logiciel complet',
title : null
}]
If I set title to another value (a string for example), it works fine.
Thanks,
Sébastien
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Just an update : it appears that if I use an empty string it doesn't work either.
While other strings work:
I use the following version 1.4.2 for the buttons:
Looks like it works using version 1.3.1 .
Still reading the docs to see where my code that causes this problem.
EDIT : logical since title export has been introduced in 1.4.0 ...
Could you try the nightly version where this has been resolved.
Thanks,
Allan
Works like a charm, thank you!
Hi Dear, I 've just updated datatables library to v1.10.16 and I still have problem to export .xlsx file without title name. When I use title: null, MS Excel 2013 still has/wants to repair the document. I'd like to ask you to fix it in lates production datatables.net library, please. Thank you, Lukash
If you can link to a page showing the issue I would be happy to take a look and debug the issue.
Allan
EDIT: SOLUTION... I just realized that I was using buttons 1.4.1. When I switched to 1.5.1, everything works.
I am having the same issue as lukash229 while using DataTables 1.10.16 . Unfortunately, the page is not accessible on the web yet (local dev server).
When title is set to null, Excel produces the following error:
If title is set to anything else, it works fine.
Here is the relevant part of my code: