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

paddypaddy Posts: 7Questions: 1Answers: 0

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

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Sounds like you don't have the Flash plug-in installed in IE. Chrome has it installed as part of the browser.

    Allan

  • paddypaddy Posts: 7Questions: 1Answers: 0

    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

  • paddypaddy Posts: 7Questions: 1Answers: 0

    Even the link below is not exporting files in excel format.
    http://datatables.net/extensions/tabletools/

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    The example link uses csv, which is perfectly acceptable to Excel. Creating a proprietorial .xls file is something best left to Excel itself.

  • paddypaddy Posts: 7Questions: 1Answers: 0

    so You mean to say should I use csv rather than xls in my code ?

  • paddypaddy Posts: 7Questions: 1Answers: 0

    I also use csv but same result here is my code
    "sDom": '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':'csv',
                            'mColumns':'visible', //set which columns here
                            "oSelectorOpts": { filter: 'applied', order: 'current' }
                        }  ]
                }
    
  • paddypaddy Posts: 7Questions: 1Answers: 0

    @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

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    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

  • paddypaddy Posts: 7Questions: 1Answers: 0

    Thank you so much Allan.Best luck.

This discussion has been closed.