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

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

javascript將網(wǎng)頁表格導(dǎo)出Word和Excel

admin
2010年8月18日 0:45 本文熱度 4277

1、首先將網(wǎng)站的地址加入受信任的站點
2、在"工具-internet選項-安全-受信任的站點"中點“自定義級別”,在“對沒有標注安全的Acitvex控件進行初始化和腳本運行”中點選“禁止”或“啟用”,就ok了。


如何取office版本號、安裝路徑和使用者


alert("您的" + wrd.Application.Caption + "安裝路徑為: " + wrd.Application.Path + " 版本號是:" + wrd.Application.version


+ " 注冊使//用者是:" + wrd.Application.UserName)


--------------------------------------------------------------------------------


javascript將網(wǎng)頁表格導(dǎo)出Word


<script>
function AllAreaWord()
{
if(document.all("tab").rows.length==0)
{
   alert("沒有內(nèi)容可導(dǎo)!");
   return;
}
try{
   var oWD = new ActiveXObject("Word.Application");
}catch(e)
{
   alert("無法調(diào)用Office對象,請確保您的機器已安裝了Office并已將本系統(tǒng)的站點名加入到IE的信任站點列表中!");
   return;
}
var oDC = oWD.Documents.Add("",0,1);
var oRange =oDC.Range(0,1);
var sel = document.body.createTextRange();
sel.moveToElementText(tab); //tab 為導(dǎo)出數(shù)據(jù)所在的表格ID
sel.select();
sel.execCommand("Copy");
oRange.Paste();
oWD.Application.Visible = true;
}
</script>


<table id="tab" align="center" width="300" border="1" bordercolor="#2baeff" cellpadding="0" cellspacing="0" bgcolor="lightblue">
<Tr>
    <Td>1</td>
    <Td>2</td>
    <Td>3</td>
</tr>
<Tr>
    <Td>4</td>
    <Td>5</td>
    <Td>6</td>
</tr>
<Tr>
    <Td>7</td>
    <Td>8</td>
    <Td>9</td>
</tr>
</table>
<input type=button name='button_export' title="導(dǎo)出到word" onclick=AllAreaWord() value=下載到word>



--------------------------------------------------------------------------------



javascript將網(wǎng)頁表格導(dǎo)出Excel


<SCRIPT LANGUAGE="javascript">


<!--


function AutomateExcel()


{


var elTable = document.getElementById("outtable"); //outtable 為導(dǎo)出數(shù)據(jù)所在的表格ID;


var oRangeRef = document.body.createTextRange();


oRangeRef.moveToElementText( elTable );


oRangeRef.execCommand( "Copy" );


try{
var appExcel = new ActiveXObject( "Excel.Application" );
}catch(e)
{
alert("無法調(diào)用Office對象,請確保您的機器已安裝了Office并已將本系統(tǒng)的站點名加入到IE的信任站點列表中!");
return;
}


appExcel.Visible = true;


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


appExcel = null;


}


//-->


</SCRIPT>


<input type="button" name="out_excel" onClick="AutomateExcel();" value="導(dǎo)出到excel" class="notPrint">
<table border="1" cellpadding="0" cellspacing="0" id=outtable>
<tr height="28">
    <td width="27" height="86" rowspan="4" bgcolor="#ffffcc">序號</td>
    <td width="111" rowspan="4" bgcolor="#ffffcc"><div align="center">服務(wù)網(wǎng)點</div></td>
    <td width="402" colspan="7" bgcolor="#ffffcc"><div align="center">用戶滿意度</div></td>
</tr>
<tr height="19">
    <td width="100" height="39" colspan="3" rowspan="2" bgcolor="#ffffcc"><div align="center">樣本數(shù)量</div></td>
    <td width="218" colspan="3" rowspan="2" bgcolor="#ffffcc">對該服務(wù)網(wǎng)點實施本次活動的整體評價,滿分10分(平均分數(shù))</td>
    <td width="84" rowspan="3" bgcolor="#ffffcc"><div align="center">季度平均分</div></td>
</tr>
<tr height="20"> </tr>
<tr height="19">
    <td width="29" height="19" bgcolor="#ffffcc"><div align="center">4月</div></td>
    <td width="29" bgcolor="#ffffcc"><div align="center">5月</div></td>
    <td width="42" bgcolor="#ffffcc"><div align="center">合計</div></td>
    <td width="68" bgcolor="#ffffcc"><div align="center">4月</div></td>
    <td width="68" bgcolor="#ffffcc"><div align="center">5月</div></td>
    <td width="82" bgcolor="#ffffcc"><div align="center">合計</div></td>
</tr>
<tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td bgcolor="#ffffcc">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td bgcolor="#ffffcc">&nbsp;</td>
    <td bgcolor="#ffffcc">&nbsp;</td>
</tr>
<tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td bgcolor="#ffffcc">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td bgcolor="#ffffcc">&nbsp;</td>
    <td bgcolor="#ffffcc">&nbsp;</td>
</tr>
</table>


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