[英]Angularjs download table of data to csv
Can someone teach me how to convert a table of data from json into PDF? 有人可以教我如何将数据表从json转换为PDF吗? I can only find chunks of codes that are working without explanation.
我只能找到无法解释的代码。 Would be cool if someone know a place where it's explained properly and share it with me.
如果有人知道正确解释它的地方并与我分享,那将很酷。 Appreciated !
感激不尽!
Example of my table of data : 我的数据表示例:
<table class="table table-striped table-hover">
<thead>
<tr>
<th ng-click="sort('id')">Name
<span class="glyphicon sort-icon" ng-show="sortKey=='id'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('first_name')">Block No.
<span class="glyphicon sort-icon" ng-show="sortKey=='first_name'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('last_name')">Postal Code
<span class="glyphicon sort-icon" ng-show="sortKey=='last_name'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('hobby')">Street Name
<span class="glyphicon sort-icon" ng-show="sortKey=='hobby'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
</tr>
</thead>
<tbody>
<tr dir-paginate="audit in auditoriums|orderBy:sortKey:reverse|filter:search|itemsPerPage:5 | limitTo: 1 - auditoriums.length">
<td>{{audit.NAME}}</td>
<td>{{audit.ADDRESSBLOCKHOUSENUMBER}}</td>
<td>{{audit.ADDRESSPOSTALCODE}}</td>
<td>{{audit.ADDRESSSTREETNAME}}</td>
</tr>
</tbody>
</table>
You can try use of this Client-side JavaScript PDF generation 您可以尝试使用此客户端JavaScript PDF生成
var doc = new jsPDF() doc.text('Sample text', 11100221, 22,44) doc.save('sampleText.pdf')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.