您的位置:程序门 -> web 开发 -> asp



asp中如何只打印页面的部分内容


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


asp中如何只打印页面的部分内容[已结贴,结贴人:sunyang1801]
发表于:2007-01-05 14:34:00 楼主
我的asp页面分页显示一组记录,每页有‘上一页'和‘下一页'链接以及一个打印按钮,如何实现在点打印按钮时只打印记录内容,而不把‘上一页'、‘下一页'这样的链接也打印出来,并且用window.print()实现打印时会先跳出打印设置对话框,我希望在点打印按钮时不跳出打印设置对话框,而直接开始打印,该怎么实现,请高手帮忙,不胜感激!
发表于:2007-01-05 23:41:011楼 得分:0
怎么没人回啊,高手都去哪儿了?
发表于:2007-01-06 08:16:432楼 得分:5
<style>  

@media   print   {  

.noprint   {display:none}  

}  
</style>
加上这个class= "noprint "
发表于:2007-01-06 09:20:523楼 得分:0
同意楼上的.
发表于:2007-01-06 09:55:354楼 得分:0
同意
发表于:2007-01-06 17:17:195楼 得分:0
谢谢,那怎么做一个打印链接,点击后直接打印而不弹出打印设置框呢?
发表于:2007-01-08 08:08:146楼 得分:0
前一个问题已解决,后一个问题请高手再指点一下啊!
发表于:2007-01-10 10:01:297楼 得分:0
难道就真的没有人会吗?
发表于:2007-01-10 10:23:338楼 得分:10
<body   align= "center "   topmargin= "55 "   leftmargin= "13 ">
<center   class= "noprint "   >
    <object     id=webbrowser     classid=clsid:8856f961-340a-11d0-a96b-00c04fd705a2     height=0     width=0> </object>
    <input     type=button     value=打印                     onclick=document.all.webbrowser.EXECwb(6,1)>
    <input     type=button     value=直接打印     onclick=document.all.webbrowser.EXECwb(6,6)>
    <input     type=button     value=页面设置     onclick=document.all.webbrowser.EXECwb(8,1)>
  <input     type=button     value=打印预览     onclick=document.all.webbrowser.EXECwb(7,1)>
    <hr   align= "center "   width= "90% "   size= "1 "   noshade>
    </center>
......
发表于:2007-01-11 15:00:359楼 得分:0
还不结帖?
发表于:2007-01-12 09:21:5810楼 得分:0
不行啊,点击按钮后显示:ie已经阻止此站点用不安全方式使用activex控件,因此,此页可能显示不正确。怎么解决啊,另外,classid=clsid:8856f961-340a-11d0-a96b-00c04fd705a2是什么意思啊,这个id能随便设吗?真不好意思,希望楼上能不厌其烦的给我解释一下。
发表于:2007-01-12 10:58:1011楼 得分:5
取消阻止就行了,在ie的安全选项里设置。
id不能改,它是这个控件的id。
发表于:2007-01-12 11:00:2512楼 得分:0
webbrowser控件是随ie   3.0以上版本提供的一个可编程的activex控件,利用webbrowser控件可以显示、控制、分析web页,除了ie,chm格式的帮助的浏览,还广泛应用在以ie为核心的许多浏览器和其他程序中。
发表于:2007-01-12 11:09:5813楼 得分:0
统一zongxiangqun(bigbug的意见,我想问下,怎样做到这样一种效果,查询一种商品   添加到用户可看到的地方,再查询,继续添加到这个地方,然后把他们按一定的格式打印出来,比如按超市的价签格式
发表于:2007-01-12 12:12:1714楼 得分:0
zongxiangqun你好,我照你的方法试了,可是点“直接打印”按钮后还是会跳出打印对话框,不能直接打印啊!怎么回事啊?
发表于:2007-01-12 21:38:1415楼 得分:0
<!doctype   html   public   "-//w3c//dtd   html   4.0   transitional//en ">
<html>
<head>
<title>   new   document   </title>
<meta   name= "generator "   content= "editplus ">
<meta   name= "author "   content= " ">
<meta   name= "keywords "   content= " ">
<meta   name= "description "   content= " ">
</head>

<body>
<meta   http-equiv= "content-type "   content= "text/html;   charset=gb2312 ">
<meta   name= "generator "   content= "ibm   homepage   builder   2001   v5.0.0   for   windows ">
<meta   name= "progid "   content= "frontpage.editor.document ">
<title> 技术部收文处理信息系统   --   打印文件处理单 </title>
<style   media=print>
.noprint{display:none;}
.pagenext{page-break-after:   always;}
</style>
</head>
<body   align= "center "   topmargin= "55 "   leftmargin= "13 ">
<center   class= "noprint "   >
    <object     id=webbrowser     classid=clsid:8856f961-340a-11d0-a96b-00c04fd705a2     height=0     width=0> </object>
    <input     type=button     value=打印                     onclick=document.all.webbrowser.EXECwb(6,1)>
    <input     type=button     value=直接打印     onclick=document.all.webbrowser.EXECwb(6,6)>
    <input     type=button     value=页面设置     onclick=document.all.webbrowser.EXECwb(8,1)>
  <input     type=button     value=打印预览     onclick=document.all.webbrowser.EXECwb(7,1)>
    <hr   align= "center "   width= "90% "   size= "1 "   noshade>
    </center>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa </body>
</html>
===================================================================================
刚刚试过的,不会出现对话框。
发表于:2007-01-12 22:41:1116楼 得分:0
linfeng820807()   (   )   信誉:100         blog     2007-01-12   11:09:58     得分:   0    
 
 
      统一zongxiangqun(bigbug的意见,我想问下,怎样做到这样一种效果,查询一种商品   添加到用户可看到的地方,再查询,继续添加到这个地方,然后把他们按一定的格式打印出来,比如按超市的价签格式
   
 
=======================================================================
1.htm:
......
<a   href=seachfile.asp?typenum=orig_or_vary.value   target=_blank> 查找 </a>
......
------------------------------------------------------------------
seachfile.asp:
.......
<script   language= "vbscript ">
function   slctfile(fn)
window.opener.form1.fname.value=fn
' self.close()
end   function
</script>
...
<tt   onclick= "slctfile( <%=rs( "id ")%> ) "> aaaaaa </tt>
................
发表于:2007-01-12 22:42:4017楼 得分:0
linfeng820807()   (   )   信誉:100         blog     2007-01-12   11:09:58     得分:   0    
 
 
      统一zongxiangqun(bigbug的意见,我想问下,怎样做到这样一种效果,查询一种商品   添加到用户可看到的地方,再查询,继续添加到这个地方,然后把他们按一定的格式打印出来,比如按超市的价签格式
   
 
=======================================================================
1.htm:
......
<input   type=text   name=fname   class= "tx "   size=40   readonly>
<a   href=seachfile.asp?typenum=orig_or_vary.value   target=_blank> 查找 </a>
......
------------------------------------------------------------------
seachfile.asp:
.......
<script   language= "vbscript ">
function   slctfile(fn)
window.opener.form1.fname.value=fn
end   function
</script>
...
<tt   onclick= "slctfile( <%=rs( "id ")%> ) "> aaaaaa </tt>
................
发表于:2007-01-12 23:13:4318楼 得分:0
up
发表于:2007-01-13 09:02:4719楼 得分:0
路过,学习
发表于:2007-01-13 10:34:5620楼 得分:0
能对ie插件这么了解,不可思议
发表于:2007-01-14 21:15:3421楼 得分:0
哪位大哥能不能告诉我怎么开始学习asp技术
发表于:2007-01-15 09:41:0622楼 得分:0
学习.
发表于:2007-01-15 10:44:0823楼 得分:0
从看书开始,没事不要乱跑论坛来,先好好看看书,并动手联系,差不多了再来论坛.哈哈.偶一个星期就学会了.
发表于:2007-01-16 11:33:2824楼 得分:0
zongxiangqun前辈,你的代码试过可以了吗,怎么我照你试了还是不行啊,仍会跳出提示框,前两天我忙别的事,没及时回,抱歉
发表于:2007-01-17 12:35:1625楼 得分:0
这个不是代码的问题,你在工具---internet选项--安全选项里--把     active控件的选项全部改为启用就ok了
发表于:2007-01-17 22:20:2726楼 得分:0
我把active控件的选项全部改为启用,可还是不行啊,真是奇了怪了
发表于:2007-01-18 00:30:1827楼 得分:0
先收藏,再学习
发表于:2007-01-22 14:00:1628楼 得分:0
还是不行啊,哪位高手再指点一下,小弟先行谢过
发表于:2007-01-25 19:17:1329楼 得分:0
那位高手再出手相助啊!急
发表于:2007-02-12 12:08:4430楼 得分:0
还是没彻底解决,无奈中结贴。
发表于:2007-03-20 10:50:2131楼 得分:0
http://hi.baidu.com/see7di/blog/item/7dca1a238bd3594f93580742.html


快速检索

最新资讯
热门点击