求教用JSP打印当前页面的方法,JSP能调用IE自带的打印功能吗? 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 例如:我想用程序控制打印下面的页面<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>打印</title></head><body>打印</body></html>我要打这个页面,但不能按IE上的按钮,请问我用JSP怎么才能打印这个页面?? <%@ page contentType="text/html; charset=GB2312" %><html><head><title></title></head><body><form name="f1"><input type=button name="print" value="打印" onClick="window.print()"></form></body></html> 请问怎样用JSP直接调用“window.print()” 这个和JSP不搭界的,就是javascript,楼上的说得很清楚了 我给你一个js脚本吧,然后在jsp中导入这个脚本就行了. //print.jswith (document){//输出样式表表及IE打印控件 write ("<style type=\"text/css\" media=\"print\">"); write (" .noprint{display:none;}"); write(" .border:1px"); write ("</style>"); write ("<OBJECT classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2' height=0 id=WB width=0 ></object>");}function doPrintSetup(){//打印设置 WB.ExecWB(8,1);}function doPrintPreview(){//打印预览 WB.ExecWB(7,1);}function doPrint(){ //WB.ExecWB(6,1); window.print();}function showPrintBar(){ with (document) { write ("<div align=\"center\" class=\"noprint\">"); //write (" <input type=\"button\" name=\"doBack\" value=\"关闭\" onClick=\"window.close()\">"); write (" <input type=\"button\" name=\"doPrintSetup\" onClick=\"WB.ExecWB(8,1)\" value=\"页面设置\">"); write (" <input type=\"button\" name=\"doPrintPreview\" onClick=\"WB.ExecWB(7,1)\" value=\"打印预览\">"); write (" <input type=\"button\" name=\"doPrint\" value=\"打印\" onClick=\"doPrint()\">"); write ("</div>") }} 请问 xjbs(大鱼) 具体怎么做??最好能详细说明一下,偶比较笨 你可以这样:<%@ page contentType="text/html;charset=gb2312" %><html><head><title>打印</title></head><body onload="javascript:window.print();">打印</body></html>这样一运行页面就开始打印了! 因为IE没有像word那样的快速打印功能 oracle 11g 建数据库,建表,开发新手问题 jsp java ssi开发,怎么从网站的首页跳转到java的后台,再跳转到首页? jsp播放视频文件 java江西群 登录和注册 HTTP Status 404 - Servlet action is not available 菜鸟问题!! 数据库连接问题 用过tomcat和weblogic的请进来。。。 请问大侠们,如何将Excel文件的数据导入到数据库?急! 去一家公司面试的试题
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>打印</title>
</head>
<body>
打印
</body>
</html>我要打这个页面,但不能按IE上的按钮,
请问我用JSP怎么才能打印这个页面??
<html>
<head>
<title></title>
</head>
<body>
<form name="f1">
<input type=button name="print" value="打印" onClick="window.print()">
</form>
</body>
</html>
//print.js
with (document)
{//输出样式表表及IE打印控件
write ("<style type=\"text/css\" media=\"print\">");
write (" .noprint{display:none;}");
write(" .border:1px");
write ("</style>");
write ("<OBJECT classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2' height=0 id=WB width=0 ></object>");
}
function doPrintSetup()
{//打印设置
WB.ExecWB(8,1);
}
function doPrintPreview()
{//打印预览
WB.ExecWB(7,1);
}
function doPrint()
{
//WB.ExecWB(6,1);
window.print();
}
function showPrintBar()
{
with (document)
{
write ("<div align=\"center\" class=\"noprint\">");
//write (" <input type=\"button\" name=\"doBack\" value=\"关闭\" onClick=\"window.close()\">");
write (" <input type=\"button\" name=\"doPrintSetup\" onClick=\"WB.ExecWB(8,1)\" value=\"页面设置\">");
write (" <input type=\"button\" name=\"doPrintPreview\" onClick=\"WB.ExecWB(7,1)\" value=\"打印预览\">");
write (" <input type=\"button\" name=\"doPrint\" value=\"打印\" onClick=\"doPrint()\">");
write ("</div>")
}
}
最好能详细说明一下,偶比较笨
<%@ page contentType="text/html;charset=gb2312" %><html>
<head>
<title>打印</title>
</head>
<body onload="javascript:window.print();">
打印
</body>
</html>
这样一运行页面就开始打印了!