asp的特定打印代码

feixianghuli 2004-11-26 11:14:54
页面中用的IFRAME 框架,我想打印出IFRAME2中就是dw_2中的内容,请高手帮忙
代码如下:
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<BODY id=first class=BODY_MAIN>
<table id=tb class=TableInput border=1 cellPadding=1 cellSpacing=0 style="position: absolute" >
<tr height=* width=100%>
<td id=td width="100%" height=100% marginWidth=0 marginHeight=0>
<table id=tb1 class=TableInput border=1 cellPadding=1 cellSpacing=0 style="top=40;left=0;width:300;height:500;position: absolute" >
<tr height=18>
<td id=title1 width="100%" height="20" marginWidth=0 marginHeight=0 bgcolor="3366CC" style="color:FFFFFF" ><font color=FFFFFF>选择单位人员列表</font></td>
</tr>
<tr>
<td>
<IFRAME
name='dw_1'
id=dw_1
src=""
width="100%"
height="100%"
frameborder="0"
marginHeight=0
marginWidth=0>
</IFRAME>
</td>
</tr>
</table>
 

<table id=tb3 class=TableInput border=1 cellPadding=1 cellSpacing=0 style="top=0;left=310;width:700;height:500;position: absolute" >
<tr height=18>
<td id=title1 width="100%" height="20" marginWidth=0 marginHeight=0 bgcolor="3366CC" style="color:FFFFFF" ><font color=FFFFFF>只打印着个</font></td>
</tr>
<tr>
<td>
<IFRAME
name='dw_2'
id=dw_2
src=""
width="100%"
height="100%"
frameborder="0"
marginHeight=0
marginWidth=0>
</IFRAME>
</td>
</tr>
</table>
<tr height=20 width=300 id=b>
<td width="100%" height="70%">
<table width=100% border=0 cellPadding=0 cellSpacing=0 style="height=20" >
<tr>
<td valign=middle align=right>
<input type="button" value="增加" onclick="f_add('a')" id=cb_add name=cb_add class=Button>
<input type="button" value="修改" onclick="f_add('e')" id=cb_edit name=cb_edit class=Button>
<input type="button" value="删除" onclick="f_delete()" id=cb_delete name=cb_delete class=Button>
<input type="button" value="查询" onclick="f_search()" id=cb_search name=cb_search class=Button>
<input type="button" value="打印" onclick="dw_2.print()" id=cb_print name=cb_print class=Button>

</td>
</tr>
</table>
</td>
</tr>
</td>
</tr>
</table>
</BODY>
</HTML>
...全文
126 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
feixianghuli 2004-11-26
  • 打赏
  • 举报
回复
谢谢
GageCSDN 2004-11-26
  • 打赏
  • 举报
回复
<input type="button" value="打印" onclick="document.all.dw_2.document.execCommand('print');" id=cb_print name=cb_print class=Button>
zisuijing 2004-11-26
  • 打赏
  • 举报
回复
代码如下:
<HTML>
<HEAD>
<%'**************************************************%>
<%'加入打印用的脚本 %>
<script language="JavaScript" type="text/JavaScript">
function printsetup(){
// 打印页面设置
wb.ExecWB(8,1);
}
function printpreview(){
// 打印页面预览
lnbt.style.display='none';
wb.ExecWB(7,1);
lnbt.style.display='';
}

function printit()
{
if (confirm('如果您已经完成您的页面设定,请您点击确定按钮进行打印.')) {
lnbt.style.display='none';
wb.ExecWB(6,6)

} else{
lnbt.style.display='';
}
}
</script>

<%'**************************************************%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<BODY id=first class=BODY_MAIN>
<%'***************************************************
'加入打印用的按扭%>
<table width="700" border="1" cellspacing="0" cellpadding="0" align=center >

<tr height=10 id=lnbt>
<td align=center> 
<input type=button name="bt1" value="页面设置" onclick="printsetup();" ID="Button1">
<input type=button name="bt1" value="页面预览" onclick="printpreview();" ID="Button2">
<input type=button name="bt1" value="页面打印" onclick="printit();" ID="Button3">
</td>
</tr>
</table>




<%
'*******************************************************
%>
<table id=tb class=TableInput border=1 cellPadding=1 cellSpacing=0 style="position: absolute" >
<tr height=* width=100%>
<td id=td width="100%" height=100% marginWidth=0 marginHeight=0>
<table id=tb1 class=TableInput border=1 cellPadding=1 cellSpacing=0 style="top=40;left=0;width:300;height:500;position: absolute" >
<tr height=18>
<td id=title1 width="100%" height="20" marginWidth=0 marginHeight=0 bgcolor="3366CC" style="color:FFFFFF" ><font color=FFFFFF>选择单位人员列表</font></td>
</tr>
<tr>
<td>
<IFRAME
name='dw_1'
id=dw_1
src=""
width="100%"
height="100%"
frameborder="0"
marginHeight=0
marginWidth=0>
</IFRAME>
</td>
</tr>
</table>
 

<table id=tb3 class=TableInput border=1 cellPadding=1 cellSpacing=0 style="top=0;left=310;width:700;height:500;position: absolute" >
<tr height=18>
<td id=title1 width="100%" height="20" marginWidth=0 marginHeight=0 bgcolor="3366CC" style="color:FFFFFF" ><font color=FFFFFF>只打印着个</font></td>
</tr>
<tr>
<td>
<IFRAME
name='dw_2'
id=dw_2
src=""
width="100%"
height="100%"
frameborder="0"
marginHeight=0
marginWidth=0>
</IFRAME>
</td>
</tr>
</table>
<tr height=20 width=300 id=b>
<td width="100%" height="70%">
<table width=100% border=0 cellPadding=0 cellSpacing=0 style="height=20" >
<tr>
<td valign=middle align=right>
<input type="button" value="增加" onclick="f_add('a')" id=cb_add name=cb_add class=Button>
<input type="button" value="修改" onclick="f_add('e')" id=cb_edit name=cb_edit class=Button>
<input type="button" value="删除" onclick="f_delete()" id=cb_delete name=cb_delete class=Button>
<input type="button" value="查询" onclick="f_search()" id=cb_search name=cb_search class=Button>
<input type="button" value="打印" onclick="dw_2.print()" id=cb_print name=cb_print class=Button>

</td>
</tr>
</table>
</td>
</tr>
</td>
</tr>
</table>
<%'以下加入调用的对象%>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0 VIEWASTEXT></OBJECT>
</BODY>
</HTML>

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧