1
我需要我的HTML表導出用阿拉伯語數據爲XLS,PDF與阿拉伯字符
導出HTML表這是我在Plunker
代碼SO片段中的代碼失敗,因爲SO沙箱
我需要一個角度js,jquery或javascript解決方案。
[{"code":"1","libelleAr":"الصنف :أ الصنف الفرعي :أ1","libelleFr":"CAT : A /SCAT : A1","nbre":143211},{"code":"1","libelleAr":"الصنف :أ الصنف الفرعي :أ1","libelleFr":"CAT : A /SCAT : A1","nbre":11513},{"code":"5","libelleAr":"الصنف ج","libelleFr":"Categorie: C","nbre":13153},{"code":"X","libelleAr":"غير مصنّفون","libelleFr":"Non renseignée","nbre":1201},{"code":"1","libelleAr":"العملة الوحدة 1","libelleFr":"Unite 1","nbre":12152},{"code":"3","libelleAr":"الصنف :أ الصنف الفرعي :أ3","libelleFr":"CAT : A /SCAT : A3","nbre":24021},{"code":"2","libelleAr":"العملة الوحدة 3","libelleFr":"Unite 3","nbre":15111},{"code":"2","libelleAr":"العملة الوحدة 1","libelleFr":"Unite 1","nbre":43115},{"code":"4","libelleAr":"الصنف ب","libelleFr":"Categorie: B","nbre":51431},{"code":"1","libelleAr":"الصنف د","libelleFr":"Categorie: D","nbre":14151}]
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script type="text/javascript">
var myAppModule = angular.module('myApp', []);
myAppModule.controller('myCtrl', function($scope, $http) {
$http.get("par_categorie.json")
.then(function(response) {
$scope.items = response.data;
});
$scope.exportData = function() {
$('#customers').tableExport({
type: 'json',
escape: 'false'
});
};
});
</script>
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<div class="container">
<br/>
<button>XLS</button>
<button>PDF</button>
<button>PRINT</button> <br/>
<br/>
<table border="1" id="customers" class="table table-striped">
<thead>
<tr>
<th>Code</th>
<th>LibelleAr</th>
<th>Nbre</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in items">
<td>{{item.code}}</td>
<td>{{item.libelleAr}}</td>
<td>{{item.nbre}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
歡迎SO。請訪問[幫助],看看有什麼和如何問。建議:後期努力和代碼在這裏 - 我包括它,即使它打破它 – mplungjan
謝謝 http://plnkr.co/edit/TcyzSIej8FCVOTCVYNz2?p=preview –
這篇文章可能會幫助你http://stackoverflow.com/questions/ 34049956 /生成-PDF-從-HTML的使用-pdfmake合angularjs/34162901#34162901 –