急盼WEB打印的解决方案

SunnyTomorrow 2004-07-06 10:37:15
想用WEB BROWSER直接进行页面打印,不知道怎么用脚本进行打印设置!比如PAGE SIZE,横向/纵向等等。

各位高人指条名路吧……
...全文
385 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
SunnyTomorrow 2004-07-12
  • 打赏
  • 举报
回复
谢谢aspczlover(执子之手...) ,确实能行,不过不能设置页面尺寸A3/A4(BASIC版本的功能限制),分数给你了。
如果各位有更好的解决办法,欢迎到以下地址再拿分。
http://community.csdn.net/Expert/topic/3158/3158218.xml?temp=.4217188
liujiayu10 2004-07-10
  • 打赏
  • 举报
回复
<%Response.ContentType = "application/vnd.ms-excel"%>

放到你的网页中,取代
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

你会发现数据表在Excel里输出了!

atao98 2004-07-10
  • 打赏
  • 举报
回复
dullwolf的做法差不多,这种有时挺烦的,ScriptX.cab听说不错,可惜我弄了很久也没有弄个象样的东西来,能不能也给我一个源码?谢谢了!!atao98@21cn.com
aspczlover 2004-07-10
  • 打赏
  • 举报
回复
可以吗?
SunnyTomorrow 2004-07-10
  • 打赏
  • 举报
回复
dullwolf的做法只能直接按照IE的功能来打印,不够的
aspczlover 2004-07-09
  • 打赏
  • 举报
回复
对 是ScriptX.cab
只要这个路径对了 就自动下载并注册
codebase="kongjian/Script factory.cab#Version=5,60,0,360"
SunnyTomorrow 2004-07-09
  • 打赏
  • 举报
回复
Email : wei_gy.ncxx@gxep.com.cn
这个是不是ScriptX.cab??是不是需要license ?不然只能在localhost域名下使用?
希望在邮件中能提供实例程序,如果能正常运行必然满分送上!!
蛋高8 2004-07-09
  • 打赏
  • 举报
回复
楼上的维字不错
dullwolf 2004-07-09
  • 打赏
  • 举报
回复
http://218.1.120.114/ybquery/
dullwolf 2004-07-09
  • 打赏
  • 举报
回复


人生,是大写的,签字,呜,嗷,UP!~~~~~

___ __ __
/ __ \ __ __ /\ \ /\ \
/ /_/\ \ /\ \ /\ \\ \ \ \ \ \
/\ \ \ \ \\ \ \ \ \ \\ \ \ \ \ \
\ \ \_\_\ \\ \ \_\_\ \\ \ \___\ \ \___
\ \_______\\ \_______\\ \____\\ \____ \/_______/ \/_______/ \/____/ \/____/
__ ___ ____ __ ________
/\ \ |\ \| _\ _______ /\ \ /\ _____ \ \ \ \| \\\ \/ /\ ___ \\ \ \ \ \ \___/_
\ \ \ | \\\ \ \ \ \_/\ \\ \ \ \ \ ____\
\ \ \| |\ \/ \ \ \ \\_\ \\ \ \__ \ \ \___/
\ \___|\\___/| \ \______\\ \____\\ \___\
\|___| |___|/ \/______/ \/____/ \/___/



aspczlover 2004-07-09
  • 打赏
  • 举报
回复
用个小物件最好:给我邮箱我发过去给你
<object id="factory" style="display:none" viewastext classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="kongjian/Script factory.cab#Version=5,60,0,360"></object>

<script language=javascript>
function window.onload()

{

factory.printing.header = "页眉"
//factory.printing.footer ="页码,&p/&P"
factory.printing.footer ="&b页码,第&p页/共&P页&b"


//横向
factory.printing.portrait = false
factory.printing.leftMargin = 10
factory.printing.topMargin = 10
factory.printing.rightMargin = 11
factory.printing.bottomMargin = 15

}
</script>
SunnyTomorrow 2004-07-09
  • 打赏
  • 举报
回复
aspczlover(执子之手...) 能顺便给份源代码看看么?
leisang 2004-07-09
  • 打赏
  • 举报
回复
web打印效果惨不忍睹
wweight 2004-07-09
  • 打赏
  • 举报
回复
我也想了解这个问题,关注!
cghdenglu 2004-07-09
  • 打赏
  • 举报
回复
关注
SunnyTomorrow 2004-07-08
  • 打赏
  • 举报
回复
我的报表有各种样式,起码要能用程序设置纸张,比如A3/A4,是横向还是纵向,要打多少份等等,总不能让客户每次打印前都去设置这些东西吧……有办法么?
yslcuk 2004-07-06
  • 打赏
  • 举报
回复
<html>
<head>
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<title>看看</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--media=print 这个属性可以在打印时有效-->

<style media=print>
.Noprint{display:none;}
.PageNext{page-break-after: always;}
</style>

<style>
.tdp
{
border-bottom: 1 solid #000000;
border-left: 1 solid #000000;
border-right: 0 solid #ffffff;
border-top: 0 solid #ffffff;
}
.tabp
{
border-color: #000000 #000000 #000000 #000000;
border-style: solid;
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 1px;
border-left-width: 1px;
}
.NOPRINT {
font-family: "宋体";
font-size: 9pt;
}

</style>

</head>

<body >
<center class="Noprint" >
<p>
<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)>

</p>
<p> <input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1)>
<br/>
</p>
<hr align="center" width="90%" size="1" noshade>
</center>

<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="tabp">
<tr>
<td colspan="3" class="tdp">第1页</td>
</tr>
<tr>
<td width="29%" class="tdp"> </td>
<td width="28%" class="tdp"> </td>
<td width="43%" class="tdp"> </td>
</tr>
<tr>
<td colspan="3" class="tdp"> </td>
</tr>
<tr>
<td colspan="3" class="tdp"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" class="tdp"><p>这样的报表</p>
<p>对一般的要求就够了。</p></td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<hr align="center" width="90%" size="1" noshade class="NOPRINT" >
<!--分页-->
<div class="PageNext"></div>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="tabp">
<tr>
<td class="tdp">第2页</td>
</tr>
<tr>
<td class="tdp">看到分页了吧</td>
</tr>
<tr>
<td class="tdp"> </td>
</tr>
<tr>
<td class="tdp"> </td>
</tr>
<tr>
<td class="tdp"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" class="tdp"><p>这样的报表</p>
<p>对一般的要求就够了。</p></td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

28,390

社区成员

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

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