html到excel导出 [英] html to excel Export

查看:129
本文介绍了html到excel导出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < table id =tabletitle =bannerborder = 1align =center> 
< tr>< th> ID< / th>< th>名称< / th>< th> Month< / th>< th>节省< / th>< / tr>
< tr>< td> 101< / td>< td> Ramesh< / td>< td> 1月< / td>< td> $ 100< / td>< / tr>
< tr>< td> 102< / td>< td> Ram< / td>< td> Feb< / td>< td> $ 200< / td>< / tr>
< tr>< td> 103< / td>< td> Ramna< / td>< td> Mar< / td>< td> $ 300< / td>< / tr>
< / table>
< / body>
< / html>

我正在使用Mozilla 3.6 .so如何将结果导出到Excel工作表?

如果您的意思是VinalC在其中一个意见中的定义,则导出生成的HTML而不必再次访问服务器,则

解决方案

Downloadify 可以正常工作。



说明在GitHub上:


这个库是一个小型的JavaScript + Flash库,允许您在浏览器中即时生成文件,而无需服务器相互作用。允许您生成vCard,调色板,自定义代码等的Web应用程序将受益于使用此库。除了提高速度(无需往返服务器),此解决方案可以减少现有Web应用程序的数据库和服务器负载。这不是一个从服务器强制下载文件的库。它根本不与服务器进行交互。


我实际上在我们的业务环境中与jquery 1.4.4一起使用它。我必须显示10K +行和15个列的表格,这些表格组成13.5mb的数据。

  $('#tbl_purchase_groups_download ').downloadify({
'filename':'Purchase_groups.xls',
'data':html_wrapper_pre + document.getElementById('purchase_groups')innerHTML + html_wrapper_after});

html_wrapper_pre html_wrapper_after 是提供编码的开启和关闭html结构。


I have a table in HTML format.

<table  id="table" title="banner"  border="1" align="center" >
<tr><th>ID</th><th>Name</th><th>Month</th><th>Savings</th></tr>
<tr><td>101</td><td>Ramesh</td><td>January</td><td>$100</td></tr>
<tr><td>102</td><td>Ram</td><td>Feb</td><td>$200</td></tr>
<tr><td>103</td><td>Ramna</td><td>Mar</td><td>$300</td></tr>
</table>
    </body>
    </html>

I am using Mozilla 3.6 .so how can I export the results to Excel sheet ?

解决方案

if you mean, as statet by VinayC in one of the comments, to export the generated HTML without having to make another trip to the server, it works just fine with Downloadify.

Description on GitHub:

This library is a tiny JavaScript + Flash library that allows you to generate files on the fly, in the browser, without server interaction. Web applications that allow you to generate vCards, color palettes, custom code, etc would benefit from using this library. In addition to increasing speed (no round trip to the server) this solution can reduce the database and server load of existing web applications. This is not a library to ‘force download’ a file from a server. It does not interact with a server at all.

I am actually using it together with jquery 1.4.4 in our business-environment. I have to display tables with 10k+ rows and about 15 cols which make up for 13.5mb of data.

$('#tbl_purchase_groups_download').downloadify({
            'filename' : 'Purchase_groups.xls',
            'data' : html_wrapper_pre + document.getElementById('purchase_groups').innerHTML + html_wrapper_after});

html_wrapper_pre and html_wrapper_after are the opening and closing html-structures with provided encoding.

这篇关于html到excel导出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆