//function exportExcel(IDP, IDEXP){ // $("#"+IDP).battatech_excelexport({ // containerid: IDEXP // , datatype: 'table' // }); //} function exportExcel(IDP, IDEXP){ function GetIEVersion() { var sAgent = window.navigator.userAgent; var Idx = sAgent.indexOf("MSIE"); // If IE, return version number. if (Idx > 0) return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx))); // If IE 11 then look for Updated user agent string. else if (!!navigator.userAgent.match(/Trident\/7\./)) return 11; else return 0; //It is not IE } if (GetIEVersion() > 0) { var tab_text=""; var textRange; var j=0; var tab = document.getElementById(IDP); // id of table for(j = 0 ; j < tab.rows.length ; j++) { tab_text=tab_text+tab.rows[j].innerHTML+""; } tab_text=tab_text+"
"; tab_text= tab_text.replace(/]*>|<\/A>/g, "");//remove if u want links in your table tab_text= tab_text.replace(/]*>/gi,""); // remove if u want images in your table tab_text= tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var txtArea1 = document.getElementById(IDP+"exclprnt"); txtArea1.contentWindow.document.open("txt/html","replace"); txtArea1.contentWindow.document.write(tab_text); txtArea1.contentWindow.document.close(); txtArea1.contentWindow.focus(); var sa=txtArea1.contentWindow.document.execCommand("SaveAs",true,"Dettaglio valori.xls"); } else { $("#"+IDP).table2excel({ exclude: ".noExl", name: "Results", filename: "Dettaglio valori" }); } }