| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1509 人关注过本帖
标题:[求助]在asp中怎样实现分页打印?
只看楼主 加入收藏
tang688
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1219
专家分:35
注 册:2004-12-25
收藏
得分:0 
如果你要让你的用户也知道的话就做一个帮助页面吧

2005-09-18 16:32
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
收藏
得分:0 
可以用CSS样式来控制哪些内容是要打印的,哪些是不打印的,也可以在页面中相应位置插入分页符强制分页打印
[CODE]<html><HEAD><TITLE>报表打印</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>
 .page { page-break-after: always }
 @media print {
  .notPrint { visibility:hidden; }
 }
</STYLE>
</HEAD>
<BODY leftMargin=0 topMargin=0 onload=JavaScript:InitTable()>
<TABLE height=50 width=639 align=center border=0>
<TBODY>
<TR>
<TH align=middle><FONT size=4>会 计 档 案 (凭 证) 统 计 台 帐</FONT></TD></TD></TR></TBODY></TABLE>
<TABLE id=TempTable style="FONT-SIZE: 13px" borderColor=#000000 cellSpacing=0 width=639 align=center bgColor=#ffffff border=1>
<TBODY>
<TR id=statTableHead1 align=middle height=40>
<TD width="12%" rowSpan=2>时间</TD>
<TD width="9%" rowSpan=2>年度</TD>
<TD colSpan=2>现金</TD>
<TD colSpan=2>银行</TD>
<TD colSpan=2>转帐</TD>
<TD colSpan=2>合计</TD>
<TD width="15%" rowSpan=2>备注</TD></TR>
<TR id=statTableHead2 align=middle height=40>
<TD width="8%">新收</TD>
<TD width="8%">累计</TD>
<TD width="8%">新收</TD>
<TD width="8%">累计</TD>
<TD width="8%">新收</TD>
<TD width="8%">累计</TD>
<TD width="8%">新收</TD>
<TD width="8%">累计</TD></TR>
<TR id=statTableBody1 align=middle height=40>
<TD>1</TD>
<TD>1997</TD>
<TD>11</TD>
<TD>11</TD>
<TD>22</TD>
<TD>22</TD>
<TD>33</TD>
<TD>33</TD>
<TD>66</TD>
<TD>66</TD>
<TD>  </TD></TR>
<TR id=statTableBody2 align=middle height=40>
<TD>2</TD>
<TD>1998</TD>
<TD>21</TD>
<TD>32</TD>
<TD>12</TD>
<TD>34</TD>
<TD>16</TD>
<TD>49</TD>
<TD>47</TD>
<TD>113</TD>
<TD>  </TD></TR>
<TR id=statTableBody3 align=middle height=40>
<TD>3</TD>
<TD>1999</TD>
<TD>14</TD>
<TD>46</TD>
<TD>34</TD>
<TD>68</TD>
<TD>32</TD>
<TD>81</TD>
<TD>80</TD>
<TD>193</TD>
<TD>  </TD></TR>
<TR id=statTableBody4 align=middle height=40>
<TD>1</TD>
<TD>1997</TD>
<TD>11</TD>
<TD>11</TD>
<TD>22</TD>
<TD>22</TD>
<TD>33</TD>
<TD>33</TD>
<TD>66</TD>
<TD>66</TD>
<TD>  </TD></TR>
<TR id=statTableBody5 align=middle height=40>
<TD>2</TD>
<TD>1998</TD>
<TD>21</TD>
<TD>32</TD>
<TD>12</TD>
<TD>34</TD>
<TD>16</TD>
<TD>49</TD>
<TD>47</TD>
<TD>113</TD>
<TD>  </TD></TR>
<TR id=statTableBody6 align=middle height=40>
<TD>3</TD>
<TD>1999</TD>
<TD>14</TD>
<TD>46</TD>
<TD>34</TD>
<TD>68</TD>
<TD>32</TD>
<TD>81</TD>
<TD>80</TD>
<TD>193</TD>
<TD>  </TD></TR>
<TR id=statTableBody7 align=middle height=40>
<TD>1</TD>
<TD>1997</TD>
<TD>11</TD>
<TD>11</TD>
<TD>22</TD>
<TD>22</TD>
<TD>33</TD>
<TD>33</TD>
<TD>66</TD>
<TD>66</TD>
<TD>  </TD></TR>
<TR id=statTableBody8 align=middle height=40>
<TD>2</TD>
<TD>1998</TD>
<TD>21</TD>
<TD>32</TD>
<TD>12</TD>
<TD>34</TD>
<TD>16</TD>
<TD>49</TD>
<TD>47</TD>
<TD>113</TD>
<TD>  </TD></TR>
<TR id=statTableBody9 align=middle height=40>
<TD>3</TD>
<TD>1999</TD>
<TD>14</TD>
<TD>46</TD>
<TD>34</TD>
<TD>68</TD>
<TD>32</TD>
<TD>81</TD>
<TD>80</TD>
<TD>193</TD>
<TD>  </TD></TR>
<TR id=statTableBody10 align=middle height=40>
<TD>1</TD>
<TD>1997</TD>
<TD>11</TD>
<TD>11</TD>
<TD>22</TD>
<TD>22</TD>
<TD>33</TD>
<TD>33</TD>
<TD>66</TD>
<TD>66</TD>
<TD>  </TD></TR>
<TR id=statTableBody11 align=middle height=40>
<TD>2</TD>
<TD>1998</TD>
<TD>21</TD>
<TD>32</TD>
<TD>12</TD>
<TD>34</TD>
<TD>16</TD>
<TD>49</TD>
<TD>47</TD>
<TD>113</TD>
<TD>  </TD></TR>
<TR id=statTableBody12 align=middle height=40>
<TD>3</TD>
<TD>1999</TD>
<TD>14</TD>
<TD>46</TD>
<TD>34</TD>
<TD>68</TD>
<TD>32</TD>
<TD>81</TD>
<TD>80</TD>
<TD>193</TD>
<TD>  </TD></TR>
<TR id=statTableBody13 align=middle height=40>
<TD>1</TD>
<TD>1997</TD>
<TD>11</TD>
<TD>11</TD>
<TD>22</TD>
<TD>22</TD>
<TD>33</TD>
<TD>33</TD>
<TD>66</TD>
<TD>66</TD>
<TD>  </TD></TR>
<TR id=statTableBody14 align=middle height=40>
<TD>2</TD>
<TD>1998</TD>
<TD>21</TD>
<TD>32</TD>
<TD>12</TD>
<TD>34</TD>
<TD>16</TD>
<TD>49</TD>
<TD>47</TD>
<TD>113</TD>
<TD>  </TD></TR>
<TR id=statTableBody15 align=middle height=40>
<TD>3</TD>
<TD>1999</TD>
<TD>14</TD>
<TD>46</TD>
<TD>34</TD>
<TD>68</TD>
<TD>32</TD>
<TD>81</TD>
<TD>80</TD>
<TD>193</TD>
<TD>  </TD></TR>
<TR id=statTableBody16 align=middle height=40>
<TD>1</TD>
<TD>1997</TD>
<TD>11</TD>
<TD>11</TD>
<TD>22</TD>
<TD>22</TD>
<TD>33</TD>
<TD>33</TD>
<TD>66</TD>
<TD>66</TD>
<TD>  </TD></TR>
<TR id=statTableBody17 align=middle height=40>
<TD>2</TD>
<TD>1998</TD>
<TD>21</TD>
<TD>32</TD>
<TD>12</TD>
<TD>34</TD>
<TD>16</TD>
<TD>49</TD>
<TD>47</TD>
<TD>113</TD>
<TD>  </TD></TR>
<TR id=statTableBody18 align=middle height=40>
<TD>3</TD>
<TD>1999</TD>
<TD>14</TD>
<TD>46</TD>
<TD>34</TD>
<TD>68</TD>
<TD>32</TD>
<TD>81</TD>
<TD>80</TD>
<TD>193</TD>
<TD>  </TD></TR>
<TR id=statTableBody19 align=middle height=40>
<TD>1</TD>
<TD>1997</TD>
<TD>11</TD>
<TD>11</TD>
<TD>22</TD>
<TD>22</TD>
<TD>33</TD>
<TD>33</TD>
<TD>66</TD>
<TD>66</TD>
<TD>  </TD></TR>
<TR id=statTableBody20 align=middle height=40>
<TD>2</TD>
<TD>1998</TD>
<TD>21</TD>
<TD>32</TD>
<TD>12</TD>
<TD>34</TD>
<TD>16</TD>
<TD>49</TD>
<TD>47</TD>
<TD>113</TD>
<TD>  </TD></TR></TBODY></TABLE>
<TABLE class=page style="FONT-SIZE: 13px" height=30 cellSpacing=0 cellPadding=0 width=639 align=center border=0>
<TBODY>
<TR>
<TD align=middle>第 1 页 </TD></TR></TBODY></TABLE>
<TABLE height=50 width=639 align=center border=0>
<TBODY>
<TR>
<TH align=middle><FONT size=4>会 计 档 案 (凭 证) 统 计 台 帐</FONT></TD></TD></TR></TBODY></TABLE>
<TABLE id=TempTable style="FONT-SIZE: 13px" borderColor=#000000 cellSpacing=0 width=639 align=center bgColor=#ffffff border=1>
<TBODY>
<TR id=statTableHead1 align=middle height=40>
<TD width="12%" rowSpan=2>时间</TD>
<TD width="9%" rowSpan=2>年度</TD>
<TD colSpan=2>现金</TD>
<TD colSpan=2>银行</TD>
<TD colSpan=2>转帐</TD>
<TD colSpan=2>合计</TD>
<TD width="15%" rowSpan=2>备注</TD></TR>
<TR id=statTableHead2 align=middle height=40>
<TD width="8%">新收</TD>
<TD width="8%">累计</TD>
<TD width="8%">新收</TD>
<TD width="8%">累计</TD>
<TD width="8%">新收</TD>
<TD width="8%">累计</TD>
<TD width="8%">新收</TD>
<TD width="8%">累计</TD></TR>
<TR id=statTableBody21 align=middle height=40>
<TD>3</TD>
<TD>1999</TD>
<TD>14</TD>
<TD>46</TD>
<TD>34</TD>
<TD>68</TD>
<TD>32</TD>
<TD>81</TD>
<TD>80</TD>
<TD>193</TD>
<TD>  </TD></TR>
<TR id=statTableBody22 align=middle height=40>
<TD>1</TD>
<TD>1997</TD>
<TD>11</TD>
<TD>11</TD>
<TD>22</TD>
<TD>22</TD>
<TD>33</TD>
<TD>33</TD>
<TD>66</TD>
<TD>66</TD>
<TD>  </TD></TR>
<TR id=statTableBody23 align=middle height=40>
<TD>2</TD>
<TD>1998</TD>
<TD>21</TD>
<TD>32</TD>
<TD>12</TD>
<TD>34</TD>
<TD>16</TD>
<TD>49</TD>
<TD>47</TD>
<TD>113</TD>
<TD>  </TD></TR>
<TR id=statTableBody24 align=middle height=40>
<TD>3</TD>
<TD>1999</TD>
<TD>14</TD>
<TD>46</TD>
<TD>34</TD>
<TD>68</TD>
<TD>32</TD>
<TD>81</TD>
<TD>80</TD>
<TD>193</TD>
<TD>  </TD></TR></TBODY></TABLE>
<TABLE style="FONT-SIZE: 13px" height=30 cellSpacing=0 cellPadding=0 width=639 align=center border=0>
<TBODY>
<TR>
<TD align=middle>第 2 页 </TD></TR></TBODY></TABLE>
<DIV class=notPrint id=TempTableDiv> </DIV></BODY></html>[/CODE]

天津网站建设 http://www./
2005-09-18 21:45
windy2yuyu
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2005-8-3
收藏
得分:0 
嘿嘿,,,,谢谢两位,俺先试试啊
2005-09-19 08:18
windy2yuyu
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2005-8-3
收藏
得分:0 
我的数据都是从数据库里面查出来的,要进入页面的时候才能生成,而不是早就在那的啊,
2005-09-19 08:43
windy2yuyu
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2005-8-3
收藏
得分:0 
以下是引用tang688在2005-9-18 16:29:36的发言: 哈哈,这个我的办法最好,其实你只要对IE进行一下设置就可以很方便地解决你的问题 不必这么麻烦的,还写一大堆的东东. 你只需要这么做 在IE中点文件,点打印,在打印的对话框中选选项,进入选项的对话框后把"打印链接的所有文件"前的钩给打上就可以了 注意 这样会把所有的页面都打出了,如果你只想打几页,请在程序中把你要打的东东选出就可以了
呵呵,你这个方法对付静态的页面有用,但我这个是 动态的,你没看到就是不存在啊,这怎么搞呢
2005-09-19 09:08
greatyollow
Rank: 1
等 级:新手上路
帖 子:74
专家分:0
注 册:2007-10-4
收藏
得分:0 
楼上讲了这么多,我一句也没看明白

我也学整了一个分页程序,显示正确,就是不知道怎么才能让它一页一页打出来.

朋友们,提点思路.
2007-10-06 12:35
快速回复:[求助]在asp中怎样实现分页打印?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018598 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved