Kalyani Shevale

Kalyani Shevale

  • 575
  • 2.9k
  • 36.7k

when data convert in Excel that time marathi data changed

Aug 26 2019 1:41 AM
I have table export in Excel file that time Marathi data is automatically converted in another language but I want this Marathi data as it in Excel file column.
 
please check below my code.
 
please help me.
  1. function fnExcelReport() {    
  2.     var tab_text = " ";    
  3.     var textRange; var j = 0;    
  4.     tab = document.getElementById('headerTable'); // id of table    
  5.     
  6.     for (j = 0 ; j < tab.rows.length ; j++) {    
  7.         tab_text = tab_text + tab.rows[j].innerHTML + "";    
  8.         //tab_text=tab_text+"";    
  9.     }    
  10.     
  11.     tab_text = tab_text + "";    
  12.     tab_text = tab_text.replace(/]*>|<\/A>/g, "");//remove if u want links in your table    
  13.     tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table    
  14.     tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params    
  15.     
  16.     var ua = window.navigator.userAgent;    
  17.     var msie = ua.indexOf("MSIE ");    
  18.     
  19.     if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))      // If Internet Explorer    
  20.     {    
  21.         txtArea1.document.open("txt/html""replace");    
  22.         txtArea1.document.write(tab_text);    
  23.         txtArea1.document.close();    
  24.         txtArea1.focus();    
  25.         sa = txtArea1.document.execCommand("SaveAs"true"Say Thanks to MIPL.xls");    
  26.     }    
  27.     else                 //other browser not tested on IE 11    
  28.         sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text));    
  29.     
  30.     return (sa);    
  31. }  

Answers (1)