Error when trying to remove title from Excel Export
Error when trying to remove title from Excel Export

I'm having some issues trying to remove the title form an Excel export. Right now I'm extending the buttons to set the filename, but when I export the file the first row is the page title that's set in my HTML page. I saw that this can be removed from the file by setting the title to an empty string. This works for CSV and PDF files, but when I open the Excel file I get a message from Excel that there was a problem with the content in the file being generated (This happens if I set the title to null as well). I get a modal popup from Excel asking if I want to continue. When the load is complete the file appears to be correct, but I need to be able export the excel file without a huge error message appearing every time. Anyone have any experience with this? Below is the code:
$(document).ready(function () {
$('#<%= gvReport.ClientID %>').DataTable({
dom: 'Bfrtip',
buttons: [
{
extend: 'excel',
filename: 'MostRecentVideoCreatedByDealer',
title: ''
},
{
extend: 'csv',
filename: 'MostRecentVideoCreatedByDealer',
title: ''
},
{
extend: 'pdf',
filename: 'MostRecentVideoCreatedByDealer',
title: ''
}
],
paging: false,
searching: false,
order: [[1, 'desc']]
});
})
Thanks!
This question has accepted answers - jump to:
Answers
You likely need to upgrade Buttons. A forum search brings up this recent post:
https://datatables.net/forums/discussion/44759
Kevin
Yup - the nightly has the fix. I plan to tag a new release fairly soon (if not this week, then next).
Allan
Thank you so much for the quick reply. This is very helpful.
Also great job on this software! I absolutely love DataTables!
Hello, has there been any change in allowing the naming of the file with specified title but removing the title showing up as header in excel doc?
Since this thread is over a year old I decided to try the latest Buttons version and it works
Used the above example here with the latest code versions from the Download Builder:
http://live.datatables.net/taxaweyu/1/edit
Kevin
Thank you very much, I will try it out! Greetings!