In today’s post we’ve had a super quick look if developers are still integrating with MS Word and MS Excel. The short answer is no – there doesn’t seem to be much going on with Microsoft anymore especially with HTML5 WYSIWYG’s becoming more popular. The only thing appearing sometimes is CSV’s format for data and importing that into tables, however it seems more appropriate to use XML or JSON for this. Either way was worth a quick look.
1. ngCSV
2. AngularJS CSV Binding
3. Angular-UI ngHandsontable
4. Export HTML table to Excel in AngularJS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
myApp.factory('Excel',function($window){ var uri='data:application/vnd.ms-excel;base64,', template='<!--[if gte mso 9]>{worksheet}<![endif]--><table>{table}</table>', base64=function(s){return $window.btoa(unescape(encodeURIComponent(s)));}, format=function(s,c){return s.replace(/{(\w+)}/g,function(m,p){return c[p];})}; return { tableToExcel:function(tableId,worksheetName){ var table=$(tableId), ctx={worksheet:worksheetName,table:table.html()}, href=uri+base64(format(template,ctx)); return href; } }; }) .controller('MyCtrl',function(Excel,$timeout){ $scope.exportToExcel=function(tableId){ // ex: '#my-table' $scope.exportHref=Excel.tableToExcel(tableId,'sheet name'); $timeout(function(){location.href=$scope.fileData.exportHref;},100); // trigger download } }); |
5. KenduUI Export to Excel
Other useful code examples:
RT @angularjs4u: 5 AngularJS Microsoft Word & Excel Integrations: In today’s post we’ve had a super quick look if developer… http://t.co/…
RT @angularjs4u: 5 AngularJS Microsoft Word & Excel Integrations: In today’s post we’ve had a super quick look if developer… http://t.co/…
RT @oguzgurkan: “5 AngularJS Microsoft Word & Excel Integrations” http://t.co/4xeYZzQlzB
RT @oguzgurkan: “5 AngularJS Microsoft Word & Excel Integrations” http://t.co/4xeYZzQlzB
I am ableto download excel from angularjs but after downloading hyperlinks are not retained in excel . i am using angularjs and backend java