高分出手,为了获取ASP下的报表分页打印,请大家指点!

gzcsdn 2003-10-16 03:53:01
高分出手,为了获取ASP下的报表分页打印,请大家指点!
...全文
40 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
IsMe 2003-11-03
  • 打赏
  • 举报
回复
ABCReport下载:
http://sgreport.nease.net
IsMe 2003-11-03
  • 打赏
  • 举报
回复
ABCReport 一个用于B/S C/S下的报表打印工具
对于Web打印,支持在IIS服务器运行组件,生成表格页面到客户端打印
B/S、C/S下的打印效果完全一致,包括斜线等表格特效。
gzcsdn 2003-11-01
  • 打赏
  • 举报
回复
to dingqigwd(iori)

你这个分页程序我之前都有用过,就是感觉用它来做打印打页好像不太现实和方便罢了...
dingqigwd 2003-10-30
  • 打赏
  • 举报
回复
你自己不会设置页面参数啊!这个分页程序是我给公司作过的一个页面,功能非常强大,可以实现跳转等功能!
zjg791015 2003-10-28
  • 打赏
  • 举报
回复
顶!这个方法不错!
vivisogood 2003-10-28
  • 打赏
  • 举报
回复
40做成一个参数传过去
在出报表之前让他选择a3 就传比如80 a4就传比如40。 一般是这样做的!
qunluo 2003-10-27
  • 打赏
  • 举报
回复
帮你顶!
gzcsdn 2003-10-27
  • 打赏
  • 举报
回复
to dingqigwd(iori)

你的分页那相当于也是定死的,比如我定A4纸为40行一页,如人家换了A3或A4B的纸还不是乱了!
dingqigwd 2003-10-26
  • 打赏
  • 举报
回复
给你我做过项目的分页代码,自己看,看不懂不会用再问吧!

<%
const MaxPerPage=5
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j

dim typename
filename="liuyan.asp"

typename="用户信息反馈"
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if

%>
<p>
<%
dim sql
dim rs
sql="select * from liuyan order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>还没有人来留言!</p>"
else
response.write "<center>"&"<font color=blue>"&"留言列表"&"</font>"&"</center>"
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if

end if
if currentPage=1 then
showpage totalput,MaxPerPage,"liuyan.asp"
showContent
showpage totalput,MaxPerPage,"liuyan.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"liuyan.asp"
showContent
showpage totalput,MaxPerPage,"liuyan.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"index.asp"
showContent
showpage totalput,MaxPerPage,"index.asp"
end if
end if
rs.close
end if

set rs=nothing
conn.close
set conn=nothing


sub showContent
dim i
i=0

%>
</p>
<table border="0" width="100%" cellspacing="1" cellpadding="5" bgcolor="#000000" class="1" height="7">
<tr bgcolor="#999999">
<td width="10%" align="center" valign="bottom" height="1"><font color="#ffffff"><strong>编号</strong></font></td>
<td width="60%" valign="bottom" height="1" bgcolor="#999999">
<p align="center"><font color="#ffffff"><strong>内容</strong></font></p>
</td>
<td align="center" valign="bottom" height="1" width="10%"><font color="#ffffff"><strong>邮箱</strong></font></td>
<td width="10%" align="center" valign="bottom" height="1"><font color="#ffffff"><strong>作 者</strong></font></td>
<td width="10%" align="center" valign="bottom" height="1"><font color="#ffffff"><strong>日期</strong></font></td>
</tr>
<%do while not rs.eof%>
<%
dim ft
if rs("addtime")=date() then
ft="<font color=red>"
else
ft="<font color=green>"
end if
%>
<tr>
<td width="10%" bgcolor="#FFFFFF" align="center" > <div align="center"><%=rs("ID")%> </div>
</td>
<td width="60%" bgcolor="#FFFFFF" > <div align="center"><%=rs("content")%></div>

</td>
<td bgcolor="#ffffff" align="center" width="10%" ><%=rs("useremail")%>
<td width="10%" align="center" bgcolor="#FFFFFF" >
<p><strong><a href=mailto:<%=rs("useremail")%>><%=rs("username")%></a></strong>
</td>
<td width="10%" align="center" bgcolor="#FFFFFF" >
<p><%=ft%><i><%=rs("addtime")%></i>
</td>
</tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<p>
<%

end sub

function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action="&filename&">"
response.write "<p align='center'><font color='#000080'>>>分页</font> "
if CurrentPage<2 then
response.write "<font color='#000080'>首页 上一页</font> "
else
response.write "<a href="&filename&"?page=1&>首页</a> "
response.write "<a href="&filename&"?page="¤tPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='#000080'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)
response.write ">下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
end if
response.write "<font color='#000080'> 页次:</font><strong><font color=red>"¤tPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>条留言<b>,"&maxperpage&"</b>条/页</font> "
response.write " <font color='#000080'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=input value="¤tpage&">"
response.write "  <input class=button type='submit' size=2 value='Go' name='cndok' ></span></p></form>"

end function


%>
</p>

gzcsdn 2003-10-26
  • 打赏
  • 举报
回复
TO vivisogood(新人类)
<% if ((iRec/40)=Int(iRec/40) then %>其中的iRec是什么意思?
vivisogood 2003-10-16
  • 打赏
  • 举报
回复
滚动每多少条记录的时候自动生成表头!

假如你有每40打印成一页.你可以在40页就生成一个表头啊!

例如

<% if ((iRec/40)=Int(iRec/40) then %>
<% Response.write("</table><br><br><br><table border=1 cellspacing=0 cellpadding=3 ><tr ><td width=30>序号</td><td width=50>xx</td><td width=60>xxxx</td><td width=60>xxx</td>...")
end if
%>
zhlym 2003-10-16
  • 打赏
  • 举报
回复
我也需要这东东,帮顶一下

28,390

社区成员

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

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