Export excel from table tools not showing in IE but working with chrome
Export excel from table tools not showing in IE but working with chrome
I am using datatable toolbar for export excel and colVis but export to excel button is not working with IE. Im using IE 10.
my Jquery code
function DrawAllFundTable() {
$("#AllFundsData").empty();
$("#AllFundsData").html('
');
AllFundsTable = $('#AllFundsData-Table').dataTable({
"data": AllFundDataEquity,
"aaSorting": [[0, "asc"]],
"dom": 'T<"clear">ft<"bottom"p>',
"language": {
"sSearch": "Search"
},
"iDisplayLength": 10,
"columnDefs": [
{ "targets": [0], "searchable": true, "visible": true, "title": "Fund", "sortable": true, "className": "col-xs-3" },
{ "targets": [1], "searchable": true, "visible": false, "title": "Sub Type", "sortable": true, "className": "col-xs-1" },
.....Other columns....
],
"sDom": '<"toolbar">lC<"H"Tfr>t<"F"p>',
"oColVis": {
"buttonText": "Show / hide columns",
"bRestore": true,
"sAlign": "left"
},
"oTableTools": {
"sAlign": "left",
"sSwfPath": "assets/swf/copy_csv_xls.swf",
"aButtons": [
{
"sButtonText": "Export to Excel",
'sExtends':'xls',
'mColumns':'visible', //set which columns here
"oSelectorOpts": { filter: 'applied', order: 'current' },
"sButtonClass": "back_image"
} ]
}
});
}
********JS**********
<script type="text/javascript" src="//cdn.datatables.net/plug-ins/f2c75b7247b/integration/bootstrap/3/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="//cdn.datatables.net/colvis/1.1.2/js/dataTables.colVis.min.js"></script>
<%-- <script type="text/javascript" src="http://cdn.datatables.net/colreorder/1.1.3/js/dataTables.colReorder.min.js"></script>
--%>
<script type="text/javascript" src="http://datatables.net/release-datatables/extensions/TableTools/js/dataTables.tableTools.js"></script>
*******CSS*************
<link href="http://cdn.datatables.net/colvis/1.1.2/css/dataTables.colVis.css" rel="stylesheet" />
<%-- <link href="http://cdn.datatables.net/colreorder/1.1.3/css/dataTables.colReorder.css" rel="stylesheet" /> --%>
<link href="http://datatables.net/release-datatables/extensions/TableTools/css/dataTables.tableTools.css"
rel="stylesheet" />
Please help thanks.
This question has an accepted answers - jump to answer
Answers
Sounds like you don't have the Flash plug-in installed in IE. Chrome has it installed as part of the browser.
Allan
Yes That is working but the file has no extension it is just a unicode file. In chrome the file was storing as excel file but in IE it has no extension it is just a unicode text file. type of file is "File'. Please help me on this Allan
Even the link below is not exporting files in excel format.
http://datatables.net/extensions/tabletools/
The example link uses csv, which is perfectly acceptable to Excel. Creating a proprietorial .xls file is something best left to Excel itself.
so You mean to say should I use csv rather than xls in my code ?
I also use csv but same result here is my code
"sDom": 'lC<"H"Tfr>t<"F"p>',
@allan: When i click CSV button shown in your given example it is default save as .csv extension in IE 10. Excel button is not saving in any proper format. but in my code given above. in IE 10 I need to explicitly save it as .csv unless it was not saving in any file. Let me know if I,m missing something
Thanks
You are not missing anything. This is a known "issue" and you will find a number of discussions about it in this forum if you use the search option.
Creating a valid XLS file is not something I wish to code.
However, the replacement to TableTools will create a valid XLSX file. You'll need to wait around two weeks before I release the replacement to TableTools (assuming I manage to get on top of all the support requests which are seriously piling up at the moment!).
Allan
Thank you so much Allan.Best luck.