download in CSV and Excel format issue
download in CSV and Excel format issue
nirali
Posts: 13Questions: 5Answers: 0
both CSV and Excel format in datatables, downloads data in same CSV format. How to download data in Excel format using datatables, SWF path?
This discussion has been closed.
Answers
Sounds like you are using the legacy TableTools extension. Use Buttons which replaces TableTools last year and writes an XLSX file.
Allan
Thank Allan,
for that I need to replace
dom: 'Bfrtip',
buttons: [
'copy', 'excel', 'pdf'
]
inplace of
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": SiteUrl + "/scripts/swf/copy_csv_xls_pdf.swf"
},
Please let me know if anything wrong or any js needs to be update or add.
Thanks..
Looks fine to me. The way to test it is to try it out :-)
Hi Allan,
Thanks for your response.
I tried with above code , but buttons are not displaying. I also tried to add other js files for buttons, still buttons are not displaying on page.
My code looks like this,
$('#container .table').DataTable({
//"sDom": 'T<"clear">lfrtip',
//"oTableTools": {
// "sSwfPath": SiteUrl + "/scripts/swf/copy_csv_xls_pdf.swf"
//}
"buttons": [
'copy', 'excel', 'pdf'
]
});
Also, I have added scripts under
in my main .cshtml page.
Thanks lot for your help. please suggest what can I do?
I'd be happy to help. Please link to a page showing the issue so I can debug it. Note also that your code above doesn't have a
dom
option like you suggested in your previous post.Allan
Yes, Thanks a lot. I got it. Thanks for your quick support.
resolved the issue.
Hi Allan,
while testing I found that, PDF option is not working in IE.
I am getting " Object doesn't support property or method "'defineGetter'" in console.
Any Idea or solution?
Please help!!
Sounds like you are using IE10 or earlier. The pdfmake library doesn't support IE10 or lower. That is something you would need to fix in the external library if you wanted that support. pdfmake is not part of the DataTables project.
Allan
No, I am using IE 11 windows 8.1. still PDF button is not working.
$('#listmodel .modal-body .row .panel .list-group .table').dataTable({
//"sDom": 'T<"clear">lfrtip',
//"oTableTools": {
// "sSwfPath": SiteUrl + "/scripts/swf/copy_csv_xls_pdf.swf"
//}
Please let me know if I done any mistake.
Thanks a lot for reply..
Hi Allan,
even I took latest version of .js files which are mention in the example of http://datatables.net/extensions/buttons/examples/html5/pdfPage.html.
Still I am not able to gererate PDF file in IE11.
Please help!!
That page is not working for you in IE11? It appears to work okay for me and I've not heard of any other users with that issue.
Could you check your browser isn't in compatibility mode.
Allan