我正在使用DataTables和TableTools來格式化表 ,當我希望它將表導出爲.xls時,結果 仍然是.csv。 .pdf導出工作完美無瑕,但如何使「TableTools」 將表導出爲.xls?Jquery - 表格工具如何導出爲xls?
在此先感謝
我正在使用DataTables和TableTools來格式化表 ,當我希望它將表導出爲.xls時,結果 仍然是.csv。 .pdf導出工作完美無瑕,但如何使「TableTools」 將表導出爲.xls?Jquery - 表格工具如何導出爲xls?
在此先感謝
您可以使用庫,如: http://code.google.com/p/php-excel/或 http://phpexcel.codeplex.com/
或者你也可以使用頭,使simpel XLS文件
$filename ="excelreport.xls";
$contents = "testdata1 \t testdata2 \t testdata3 \t \n";
header('Content-type: application/ms-excel');
header('Content-Disposition: attachment; filename='.$filename);
echo $contents;
試試這個,問題解決.. :)
$('#dt_gal').dataTable({ "sDom": 'T<"clear">lfrtip',
"oTableTools": {"sSwfPath": "<?php echo base_url() ?>asset/export/swf/copy_csv_xls_pdf.swf" ,
"aButtons": [
"copy",
{ "sExtends": "csv",
"sTitle": "titleExport csv",
"sFileName": "*.csv"
},
{ "sExtends": "xls",
"sTitle": "titleExportxls",
"sFileName": "*.xls" },
{ "sExtends": "pdf",
"sTitle": "titleExportpdf",
"sFileName": "*.pdf"
},
"print" ] }
});
對不起,我剛剛發現我的misatke – NiCU 2012-07-19 14:09:33