I'm trying to export HTML table to excel using angularJS. I went through so many sites and few blogs also, but I didn't get an appropriate answer. Any help/advice greatly appreciated. This is what I was able to achieve so far:
<button class="btn" ng-click="xlms()"></button>
Angularjs:
app.controller('Myctrl', function($scope){
$scope.xlms = function(){
var xl = '<html xmlns:x="urn:schemas-microsoft-com:office:excel">';
xl = xl + '<head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>';
xl = xl + '<x:Name>Test Sheet</x:Name>';
xl = xl + '<x:WorksheetOptions><x:Panes></x:Panes></x:WorksheetOptions></x:ExcelWorksheet>';
xl = xl + '</x:ExcelWorksheets></x:ExcelWorkbook></xml></head><body>';
xl = xl + document.getElementById('export').html(); --> 'export is id of html'
tab_text = tab_text + '</table></body></html>';
}
}
Further I donot know how to implement