In need of JavaScript Solution for Exporting table to Excel which works in all browsers
<p>Mr. Alfasin's answer which is posted on february 29 - 2012 on the question "I want to export a jsp table of search results to an MS-Excel '.xlsx' format file" is useful for creating the output either in CSV or HTML. </p>

<p>Similarly My Requirement is that I want the Table to be exported to Excel by clicking on Button "Export".In my code I have one issue in Exporting HTML table (in JSP Page) to Excel . As of now , it is exporting from Internet explorer but not from mozillaFireFox. There is no option of plugins of ActiveXObject in mozilla. I want to Export from all Browsers like mozilla firefox, Internet explorer. Can any one help me in this? My java Script as follows.  </p>

<pre><code>script type="text/javascript"

function Export_to_Excel() {

  alert (" Welcome !  Have a Nice Day");
  var x=excel.rows;
  var objExcel  = new ActiveXObject("Excel.Application");
  objExcel.Visible = true;
  var objWorkbook = objExcel.Workbooks.Add;

  for(i=0;i&lt;x.length;i++) {
    var y=x[i].cells;

    for(j=0;j&lt;y.length;j++) {
      objWorkbook.ActiveSheet.Cells(i+1, j+1).value=y[j].innerText;
    }

   }
}  
</code></pre>

<p>Thanks in Advance</p>
