如何能够只打印,页面上的表格,页面上的上一页,下一页,还有按钮不打印 用另外一个打印的CSS一个HTML可以用多个CSS的先是用一个,打印用一个就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 给你一个:<script>window.onbeforeprint = new Function("document.all.pr.style.display='none'");window.onafterprint = new Function("document.all.pr.style.display=''");</script>JSP文件中 out.println("<input type=button value=打印查询结果 onclick='self.print()' id='pr'>"); js<!-- function printewindow(){var win2=window.open("","report","width=800,height=460,menubar=no,scrollbars,toolbar=0,left=0,top=0");win2.document.writeln("<html><head>");win2.document.writeln("<link rel='stylesheet' href='../font.css' type='text/css'>");win2.document.writeln("<style TYPE='text/css'>");win2.document.writeln("SPAN {font: 9pt 宋体}");win2.document.writeln("</style>");win2.document.writeln("<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>");win2.document.writeln("<title>报表</title></head><body>");win2.document.writeln(document.all("report").outerHTML);win2.document.writeln("<span id=prin><INPUT onclick='window.print();' type=button value=打印本页> </span>");win2.document.writeln("<BR>");win2.document.writeln("<BR>");win2.document.writeln("</body></html>");win2.document.close();win2.focus();}//-->/////////////////jsp<table id=report width="700">...你要打印的东西</table><INPUT onclick="return printewindow();" type=button value=打开打印窗口><script language="JavaScript" src="../printdw.js"></script> 对了,在打印之前prin.style.display = 'none';prin.style.visibility = 'hidden';就去了那个打印按钮 Java 类似ActiveX 解决方案 求后台解码问题! poi SXSSFWorkbook异常 ext 对话框显示不正常 临时用到下JSP,汗。。调个函数都出这么大的问题。。大家帮忙看看。。在线给分。 跪助:各位大狭,能告诉一下,jsp中如何实现打印功能么?急呀! 在线求助,Servlet如何取得select中的所有数据 我想用replaceAll("[aaa]",""),确只能替换aaa,"[]"确不能替换掉! 如何在jsp中调用crystal报表,!!!!!!! Java Http请求message过长,30s超时 连接不上oracle,两天了 ,受不了了 ###参数传递的问题:
<script>
window.onbeforeprint = new Function("document.all.pr.style.display='none'");
window.onafterprint = new Function("document.all.pr.style.display=''");
</script>JSP文件中
out.println("<input type=button value=打印查询结果
onclick='self.print()' id='pr'>");
<!--
function printewindow()
{
var win2=window.open("","report","width=800,height=460,menubar=no,scrollbars,toolbar=0,left=0,top=0");
win2.document.writeln("<html><head>");
win2.document.writeln("<link rel='stylesheet' href='../font.css' type='text/css'>");
win2.document.writeln("<style TYPE='text/css'>");
win2.document.writeln("SPAN {font: 9pt 宋体}");
win2.document.writeln("</style>");
win2.document.writeln("<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>");
win2.document.writeln("<title>报表</title></head><body>");
win2.document.writeln(document.all("report").outerHTML);
win2.document.writeln("<span id=prin><INPUT onclick='window.print();' type=button value=打印本页> </span>");
win2.document.writeln("<BR>");
win2.document.writeln("<BR>");
win2.document.writeln("</body></html>");
win2.document.close();
win2.focus();
}
//-->/////////////////
jsp
<table id=report width="700">
...你要打印的东西
</table><INPUT onclick="return printewindow();" type=button value=打开打印窗口>
<script language="JavaScript" src="../printdw.js"></script>
prin.style.visibility = 'hidden';
就去了那个打印按钮