Excel button showing on localhost only
Excel button showing on localhost only
lancew
Posts: 10Questions: 3Answers: 0
I have the excel button setup and working on my localhost but when I copy the site contents to the server the button doesn't appear. When I use the Chrome dev tools network tab I see a call to the datatables cdn for the swf file. When I run the site on the server the call is not made. There are no Javascript errors and I am using the same client and browser.
Any ideas?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Sounds like you are using TableTools. It has been retired in favor of the Buttons extension.
Kevin
This is my code.
$(function () {
$('#AdminGrid').DataTable({
"paging": false,
dom: 'Bfrtip',
fixedHeader: {
header: true,
headerOffset: 50
//footer: true
},
buttons: [
{
extend: 'excel',
text: 'Save as excel',
exportOptions: {
modifier: {
page: 'current'
}
}
}]
});
});
The above code good. Probably will need to see the relevant parts of your HTML code to see what CSS and JS you are including. Can you provide a link to the page with the issue?
Kevin
Have you allowed Chrome to use Flash on your production server? It should typically show a "Click to enable Flash" button or similar.
Having said that, as I understand it, Flash support will be more or less removed from all browsers in future. Indeed, I plan to stop development of the Flash buttons in future.
I would strongly suggest that you use the HTML5 export buttons for Buttons rather than the Flash ones.
Allan
The browser is on a client pc and not the server. I thought the html 5 button were working as a fallback anyway.
So I now an trying to use the html 5 buttons now and the other buttons work but not excel.
I am including the Scripts/DataTables/buttons.html5.js file.
Chrome dev tools show the js file included.
Have you included JSZip on your page, which is required for
excelHtml5
?Allan
Yeah that was the missing file.
So now with the HTML 5 buttons it works local and on the server.
Thanks