以下為引用的內容: 〈html> 〈head> 〈title>ScriptX 列印〈/title> 〈meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> 〈meta name="CODE_LANGUAGE" Content="C#"> 〈meta name="vs_defaultClientScript" content="JavaScript"> 〈meta http-equiv="content-type" content="text/html; charset=gb2312"> 〈meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> 〈link href="kg.css" rel="stylesheet" type="text/css"> 〈link href="print.css" rel="stylesheet" type="text/css" media="print" > 〈script FOR=document event="onclick"> if(event.srcElement.tagName=='A'){ //alert('a click!'); event.cancelBubble = true; } 〈/script> 〈style type="text/css"> a:link {text-decoration:none} a:visited {text-decoration:none} a:active {text-decoration:none} a:hover {text-decoration:none} A { COLOR: #000000;TEXT-DECORATION: none; FONT-SIZE: 8pt;FONT-FAMILY: "";} 〈/style> 〈/head> 〈body MS_POSITIONING="GridLayout" > 〈!--這裡調用控制項ScriptX.cab--> 〈object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="ScriptX.cab#Version=6,1,431,2"> 〈/object> 〈SCRIPT defer> //用於設定列印參數 function printBase() { factory.printing.footer = "&b ScriptX 列印 &b" //頁首 factory.printing.footer = "" //頁尾 factory.printing.portrait = 〈%=orientation%> //true為縱向列印,flase為橫向列印 factory.printing.leftMargin = 1.5 //左頁面邊界 factory.printing.topMargin = 0.5 //上頁面邊界 factory.printing.rightMargin = 0.5 //右頁面邊界 factory.printing.bottomMargin = 1.0 //下頁面邊界 } 〈/SCRIPT> 〈table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bordercolor="#FFFFFF"> 〈tr bordercolor="#FFFFFF"> 〈td > 〈table width="70%" border="0" cellspacing="0" cellpadding="2" align="center"> 〈tr> 〈td align="center">〈font size="5" face="宋體">〈b>〈div name="divTitle" id="divTitle">〈/div>〈/b>〈/font>〈/td> 〈/tr> 〈tr> 〈td align="center"> 〈div id="divReport" name="divReport"> 〈input type="button" name="cmdPRINT" id="cmdPRINT" onclick="printReport()" value="列印"> 〈input type="button" onclick="window.close();" value="關閉"> 〈/div> 〈/td> 〈/tr> 〈/table> 〈/td> 〈/tr> 〈/table> 〈table width="100%" border="0" cellspacing="0" cellpadding="2" align="center"> 〈tr>〈td align="center"> 〈!-- 用於顯示divTableContainer標籤的值 --> 〈div id="divTableContainer" name="divTableContainer">〈/div> 〈/td>〈/tr> 〈tr>〈td align="center"> 〈!-- 用於顯示divChartContainer標籤的值 --> 〈div id="divChartContainer" name="divChartContainer">〈/div> 〈/td>〈/tr> 〈/table> 〈/body> 〈script language="javascript"> //使介面最大化 maxWin(); var needcon=''; document.all.divTitle.innerText = unescape('〈%=title%>'); //用於把父表單的divTableResult和divChartResult標籤的值分別轉入divTableContainer 和divChartContainer標籤中 var tableContent = window.opener.document.all.divTableResult.innerHTML; tableContent = replaceAll(tableContent,"〈A ","〈span "); tableContent = replaceAll(tableContent,"〈/A> ","〈/span> "); tableContent = replaceAll(tableContent,"〈a ","〈span "); tableContent = replaceAll(tableContent,"〈/a> ","〈/span> "); tableContent = replaceAll(tableContent,"〈input ","〈font "); tableContent = replaceAll(tableContent,"〈INPUT ","〈font "); document.all.divTableContainer.innerHTML = tableContent; document.all.divChartContainer.innerHTML = window.opener.document.all.divChartResult.innerHTML; //用於調用設定列印參數的方法和顯示預覽介面 function printReport(){ printBase(); //window.print(); factory.printing.Preview(); } function replaceAll( str, from, to ) { var idx = str.indexOf( from ); while ( idx > -1 ) { str = str.replace( from, to ); idx = str.indexOf( from ); } return str; } function maxWin() { var aw = screen.availWidth; var ah = screen.availHeight; window.moveTo(0, 0); window.resizeTo(aw, ah); } 〈/script> 〈/html> |