Hello Everyone,
How to Export the jQuery Datatable data to excel in mvc4.
Now it is exporting 1st page only I want all data export to excel in one button export.
function fnExcelReportSecond() {
var tab_text = "
";
| |
tab_text = tab_text + "
tab_text = tab_text.replace(/]*>|<\/A>/g, "");//remove if u want links in your table
tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer
{
txtArea1.document.open("txt/html", "replace");
txtArea1.document.write(tab_text);
txtArea1.document.close();
txtArea1.focus();
sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls");
}
else
sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));
return (sa);
}
$("#btn_exportlistsecond").click(function () {
fnExcelReportSecond();
})

Abhilash J APosted Aug 11, 2016, 8:40 AM
Vinay SinghPosted Aug 11, 2016, 6:50 AM
Manas MohapatraPosted Aug 11, 2016, 6:46 AM