Hi,
I have some content on div tag
after clciking of export excel button i need to export that data to excel
currently it was generating properly
probelem is that
if you can look at into screenshot
Filter values are disying on diffrenet row
my requirement is that display 3 input filter values on same row
and also at last filter also remove comma(,)
could you please check it and help me
<script>
function fnExcelReport() {
var tab_text = '<html xmlns:x="urn:schemas-microsoft-com:office:excel">';
tab_text = tab_text + '<head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>';
tab_text = tab_text + '<x:Name>Test Sheet</x:Name>';
tab_text = tab_text + '<x:WorksheetOptions><x:Panes></x:Panes></x:WorksheetOptions></x:ExcelWorksheet>';
tab_text = tab_text + '</x:ExcelWorksheets></x:ExcelWorkbook></xml></head><body>';
tab_text = tab_text + "<table border='1px'>";
tab_text = tab_text + $('#dvContainer1').html();
tab_text = tab_text + '</table></body></html>';
var data_type = 'data:application/vnd.ms-excel';
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
if (window.navigator.msSaveBlob) {
var blob = new Blob([tab_text], {
type: "application/csv;charset=utf-8;"
});
navigator.msSaveBlob(blob, 'Coupon.xls');
}
} else {
$('#test').attr('href', data_type + ', ' + encodeURIComponent(tab_text));
$('#test').attr('download', 'dynamicreport.xls');
}
}
</script>
<a href="#" id="test" @*ng-click="exportToExcel('#dvContainer1')"*@ onClick="javascript:fnExcelReport();" class="btn btn-success btn-sm"><span class="glyphicon glyphicon-download-alt"></span>Export to Excel</a>
Could you please check it and help me