Unable to export the table as excel file
Unable to export the table as excel file
lsharsharao
Posts: 3Questions: 1Answers: 0
Hi,
I am using the latest stable version of data tables and table tools for my project. The UI is appearing as expected, also the pagination and search functionality is working too. However when I click the excel button no action is performed. I see no error on my browser console.
I have initialised the table as follows
$(document).ready(function(){
$('#user_table').DataTable( {
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "js/swf/copy_csv_xls.swf"
}
} );
});
This is first time I am using this plugin so I am unsure as to where the problem might be.
Kindly help.
Thanks
This discussion has been closed.
Answers
I had to put a forward slash at the start of the path to the .swf file.
"/js/swf/copy_csv_xls.swf"
@lsharsharao - If it isn't a 404 error you are seeing, then we'll probably need a link to the page to be able to debug what is going wrong.
Allan
@allan the page is within the secured server, I will not be able to send the link. If it helps I can send the mock HTML file along with the JS and CSS files I am using .
Thanks
Are you able to create an example showing the issue using JSFiddle or https://live.datatables.net ? I don't think just looking that the HTML etc would be enough in this case, I'd need to have an actual running test case that shows the issue so I can debug it.
Allan
@allan I have created an example on JSFiddle https://jsfiddle.net/HarshaSridhar/cmdzs6tv/9/
I have added the JS files of datatables and tabletools to the fiddle as an external resource, but it seems like the datatables is not functional. Not sure if I am missing something crutial.
Please help
Thanks
div.info
elementbuttons
option in the TableTools constructor objecttype
option in TableToolsbuttonText
option in TableToolsFixing all of those should allow it to work - https://jsfiddle.net/cmdzs6tv/10/ .
However, The SWF has never worked in JSFiddle for some reason. No idea way. Try saving the example locally.
Failing that, later this week I'm going to release a replacement to TableTools which doesn't need flash.
Allan