我有一个包含许多结果页面(14列)的表格,想要导出到Excel,在AngularJS上最容易实现的是什么,即导出所有结果只有一页? 感谢您的帮助和解答:)
答案 0 :(得分:0)
var blob = new Blob([document.getElementById('exportable').innerHTML], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
});
saveAs(blob, "Report.xls");
};
你可以这样尝试
答案 1 :(得分:0)
我在使用Angular导出excel时发现了以下代码
基本上,它基于此生成一个xls:
$scope.jsonToExport = [
{
"col1data": "1",
"col2data": "Fight Club",
"col3data": "Brad Pitt"
},
{
"col1data": "2",
"col2data": "Matrix (Series)",
"col3data": "Keanu Reeves"
},
{
"col1data": "3",
"col2data": "V for Vendetta",
"col3data": "Hugo Weaving"
} ];