DataTable 导出到 excel 无效

DataTable export to excel is not working

我需要我的数据表将数据导出到 excel 文件,但我正在尝试使用 datatables.net.But 提供的示例,但我的数据表没有响应该功能。我在这里发布我的代码:

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/dataTables.tableTools.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/metallic.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/jquery-ui.css">

<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/js/jquery.dataTables.js"></script>
<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/js/zebra_datepicker.js"></script>
<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/js/dataTables.tableTools.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="<%=request.getContextPath()%>/js/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script> 
$('#mainTable').dataTable({
    dom: 'T<"clear">lfrtip',
    tableTools: {
       "sSwfPath": "../swf/copy_csv_xls_pdf.swf"
    },
    "scrollY": 300,
    "scrollCollapse": true,
    "jQueryUI": true,
    "aaSorting": [],
}); 

有人帮帮我..

tableTools: {
    "sSwfPath": "../swf/copy_csv_xls_pdf.swf",
    "aButtons": [
                {
                   'sExtends':'xls',
                    "sFileName": "*.xls"
                },
                'csv','pdf','copy','print'
    ]
},

http://jsfiddle.net/Lw5npvyd/

我之前通过下载 swf 对象并将 sswfpath 引用到该位置使它起作用。

    Please check the fiddle and change the "sSwfPath"
 with the location of the downloaded
 copy_csv_xls_pdf shockwave flash object.

您可以从 https://github.com/DataTables/TableTools/blob/master/swf/copy_csv_xls_pdf.swf

下载 swf 文件