超碰人人人人人,亚洲AV午夜福利精品一区二区,亚洲欧美综合区丁香五月1区,日韩欧美亚洲系列

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

Javascript 將網(wǎng)頁中表格導(dǎo)出為Excel

admin
2010年8月18日 0:55 本文熱度 4339


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標(biāo)題文檔</title>
<style type="text/css">
<!--
.STYLE5 {font-size: 16px; color: #990000; font-weight: bold; }
-->
</style>
</head>
<script language="javascript">


//兩種方法都可以實(shí)現(xiàn)。第一種用剪切板
function exports() {


oApplication    = new ActiveXObject ( 'Excel.Application' );
oApplication.DisplayAlerts = false;
var xlBook = oApplication.Workbooks.Add;
oActiveSheet = xlBook.Worksheets(1);


window.clipboardData.setData('Text',document.getElementById("table1").outerHTML);
alert(document.getElementById("table1").rows.length);
oActiveSheet.Paste;
oApplication.Visible   =   true;
oApplication.UserControl   =   true;  
}


//第二種逐單元格處理。


function exports2()
{
oApplication    = new ActiveXObject ( 'Excel.Application' );
oApplication.DisplayAlerts = false;
var xlBook = oApplication.Workbooks.Add;
oActiveSheet = xlBook.Worksheets(1);
var rowLength = document.getElementById("table1").rows.length;
var colLength = document.getElementById("table1").rows[0].cells.length;
for (i=0;i< rowLength;i++ )
{
   for (j=0;j< colLength ;j++ )
   {
   oActiveSheet.Cells(i+1,j+1).formulaR1C1= document.getElementById("table1").rows[ i ].cells[ j ].innerText;
   }
}
oApplication.Visible   =   true;  
oApplication.UserControl   =   true;  
}



</script>
<body>
<table width="1100" border="1" id="table1">
<tr>
    <td bgcolor="#99CC99"><span class="STYLE5">bbbbbb</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">男</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">漢族</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">河南</span></td>
</tr>
<tr>
    <td bgcolor="#99CC99"><span class="STYLE5">aaaaa</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">男</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">漢族</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">河南</span></td>
</tr>
<tr>
    <td bgcolor="#99CC99"><span class="STYLE5">aaaa</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">男</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">漢族</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">河南</span></td>
</tr>
<tr>
    <td bgcolor="#99CC99"><span class="STYLE5">aaaaa</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">男</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">漢族</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">河南</span></td>
</tr>
<tr>
    <td bgcolor="#99CC99"><span class="STYLE5">bbbbb</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">男</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">漢族</span></td>
    <td bgcolor="#99CC99"><span class="STYLE5">河南</span></td>
</tr>
</table>
<label>
<input name="button" type="button" id="button" onclick="exports();" value="導(dǎo)出為Excel" />
</label>
</body>
</html>


該文章在 2010/8/18 0:55:39 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點(diǎn)晴ERP是一款針對中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內(nèi)大量中小企業(yè)的青睞。
點(diǎn)晴PMS碼頭管理系統(tǒng)主要針對港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場、車隊(duì)、財(cái)務(wù)費(fèi)用、相關(guān)報(bào)表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點(diǎn),圍繞調(diào)度、堆場作業(yè)而開發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點(diǎn)晴WMS倉儲(chǔ)管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲(chǔ)管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號管理軟件。
點(diǎn)晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時(shí)間、不限用戶的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved