当前位置:编程学习 > C#/ASP.NET >>

js导出Excel问题。。高手进啊。。。

我用的Jquery EsayUi的表格。是通过jquery脚本渲染的dataGirld 。。现在我想导出我表格内的数据,但表格内数据是根据表格表头绑定的跟实体对应的列显示的数据。所以我导出的Excel指头表头而没有数据。。。哪位大侠。。可以告诉我我怎么就可以取到表格内的数据然后导出Excel来呢》????
附上表格代码
   <table id="tt" style="width: 1100px; height:300px;text-align:center;" title="包装计价明细"
          >
            <thead>
                <tr style="background-color: #BEDAFF;">
                   
                    <th field="Time" width="100px" align="center"  >
                        生产日期
                    </th>
                    
                    <th field="Name" width="80px" align="center">
                         操作者
                    </th>
                    
                    <th field="Classname" width="50px" align="center" >
                        班次
                    </th>
                     <th field="OneOrTwo" width="90px" align="center" >
                       单人或双人
                    </th>
                    
                    <th field="format" width="100px" align="center" >
                       管规
                    </th>
                    <th field="OneWeight" width="90px" align="center" >
                        支重
                    </th>
                     <th field="OneCount" width="90px" align="center" >
                        个人包装支数
                    </th>
                       <th field="Count" width="90px" align="center" editor="{type:'numberbox' }">
                        支数
                    </th>
                       <th field="Weight" width="90px" align="center" >
                        重量
                    </th>
                    <th field="OneMoney" width="90px" align="center" >
                        单价(元/支)
                    </th>
                    <th field="FigureMoney" width="90px" align="center" >
                        计价工资
                    </th>
                    
                     
                </tr>
            </thead>
        </table> --------------------编程问答-------------------- 因为表格内的数据是我在脚本里给该表格指定的数据源。。每个表头上都绑定的跟实体相对应的列名。。。。。。当我查出数据表格显示数据后,,我查看源代码,这里面还是这一堆代码。。数据行都没有显示在表格内。。这怎么解决啊??我现在要导出Excel 大家给点意见啊  --------------------编程问答-------------------- 憋了两天了 。。大家帮帮我
--------------------编程问答-------------------- --------------------编程问答-------------------- 我也发了个帖子问,还是没问出结果来 --------------------编程问答-------------------- 没人啊 怎么???呜呜呜 --------------------编程问答--------------------

function AllAreaExcel() {
          try{
          var oXL = new ActiveXObject("Excel.Application");
          }catch(e){
          alert("请先安装Excel再进行导出");
          return false;
          }
          var oWB = oXL.Workbooks.Add();
          var oSheet = oWB.ActiveSheet;
          oSheet.Columns.ColumnWidth =15;

          var sel = document.body.createTextRange();
          sel.moveToElementText(PrintA);

          sel.select();
          sel.execCommand("Copy");
          oSheet.Paste();
          oXL.Visible = true;
          }
--------------------编程问答-------------------- 我可以导出静态数据到Excel,,但是我的表格是动态加载的。。每个表头只有绑定的列名。。所以数据倒不出来 。。大家有解决的办法吗?? --------------------编程问答-------------------- 为啥这个问题到处都无解?
补充:.NET技术 ,  .NET技术前瞻
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,