0

我想将 html 表导出到 excel。我可以导出的所有数据。但我对复选框有疑问。我无法在 Excel 中显示我的复选框。也有一些选中的复选框。可以在excel中显示复选框吗?

我的代码;

    function CreateExcelSheet(div,table){
  if (is_gecko) {
       var div =document.getElementById(div).innerHTML;
       windowUrl = "data:application/vnd.ms-excel,";
       var printWindow = window.open(windowUrl + encodeURIComponent(div), table);
  } 
  else if (is_ie5up){
        var x = document.getElementById(table).rows;
        var xls = new ActiveXObject("Excel.Application");
        xls.visible = true
        xls.Workbooks.Add
        for (i = 0; i < x.length; i++) {
        var y = x[i].cells;
        for (j = 0; j < y.length; j++) {
            xls.cells(i + 1, j + 1).value = y[j].innerText;
        }
        }
  }
  else{
   alert("No support Excel please open whit Firefox!");
  } 
}

感谢您的帮助

4

1 回答 1

0

have you tried this? It converts data to base64 that can be processed by Excel.

https://github.com/stephen-hardy/xlsx.js

于 2013-02-13T09:14:57.247 回答