zoukankan      html  css  js  c++  java
  • angular 导出excel

    http://www.cnblogs.com/gzhlt/p/5274702.html

    引用 2 楼 u012129566 的回复:
    Quote: 引用 1 楼 loveshrimp423 的回复:
     小子,你运气好,我刚做过,找了很久才找到个能用的。

    <SCRIPT LANGUAGE="javascript">

    <!--

        function AutomateExcel() {

            var elTable = document.getElementById("table1"); //table1改成你的tableID

            var oRangeRef = document.body.createTextRange();

            oRangeRef.moveToElementText(elTable);

            oRangeRef.execCommand("Copy");

            try {
                var appExcel = new ActiveXObject("Excel.Application");
            } catch (e) {
                alert("无法调用Office对象,请确保您的机器已安装了Office并已将本系统的站点名加入到IE的信任站点列表中!");
                return;
            }

            appExcel.Visible = true;

            appExcel.Workbooks.Add().Worksheets.Item(1).Paste();

            appExcel = null;

        }

    //-->

    </SCRIPT>


    调用

     <input type="button" name="out_excel" onClick="AutomateExcel();" value="导出到excel" class="notPrint"> 
          

    还是没反应啊大哥,稍微细点再,会不会跟引用有关


    用IE,360的话要用兼容模式,可以的

  • 相关阅读:
    js 脚本学习 索引
    nodejs 学习索引
    oracle 学习 笔记
    githut 的 管理 使用
    sublime text 插件记录
    web 学习 相关索引
    wpf 自定义 无边框 窗体 resize 实现
    vs 效率工具
    ANDROID开发实用小工具
    iOS开发之Core Animation
  • 原文地址:https://www.cnblogs.com/lacey/p/5611371.html
Copyright © 2011-2022 走看看