ASP控制每页打印行数实例
来源:CSDN 发布时间:2008-04-13 06:48:00
标签:打印,实例,asp
<%
pagenum=55'指定打印行数
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>销售利润明细报表打印</TITLE>
<style type="text/css">
td {font-size:9pt; color:#000000}
A{text-decoration:none}
A:hover{color:#FF0000;text-decoration:derline}
.break{page-break-before:always}
</style>
</HEAD>
<script language="javascript">
window.print()
</script>
<BODY style="border:none" topmargin="0" leftmargin="6" onload="javascrpt:pagesetup_default();">
<script language="VbScript">
dim hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
function pagesetup_default()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&b页&p/&P"
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
end function
</script>
<%
kdname1=trim(request("kdname1"))
kdname2=trim(request("kdname2"))
keyword1=trim(request("keyword1"))
keyword2=trim(request("keyword2"))
if keyword1<>"" then
today=keyword1
else
if kdname1="" then
today=year(date())&"-"&month(date())
else
today=kdname1&"至"&kdname2
end if
end if
%>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="740" height="30">
<tr>
<td align="center">销售利润汇总报表</td>
</tr>
</table>
<%
strSQL="select autoid,sellautoid,productxili,productname,productsize,productnum,productdan,productjia,chaoshi,tiaoma,youhui,fukuan,moncount1,gongshang,lirun1,username,indate,fudate from sell where officename='"&trim(request.cookies("Myoffice"))&"' and monthjie='0' and (year(indate)=year(getdate()) and month(indate)=month(getdate())) and zhuofei is null order by autoid desc"
set rs1=server.createobject("adodb.recordset")
rs1.open strSQL,conn,1,1
%>
<table border="1" cellspacing="0" cellpadding="0" align="center" style="border-collapse: collapse" bordercolor="#000000" width="740">
<tr>
<td align="center" height="20" bgcolor="#BDCBEE" width="70" >销售单号</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="168" >商品名称(规格)</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="121" >客户</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="30" >数量</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="24" >单位</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="50" >销售价</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="23" >折%</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="52" >进货价</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="55" >小计</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="45" >利润</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="25" >付款</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="61" >销售日期</td>
</tr>
</table>
<%
moncount2=0
moncount5=0
Do while not rs1.eof
%>
<table border="1" cellpadding="0" cellspacing="0" width="740" align="center" style="border-collapse:collapse; font-size:10pt;color:#000000" bordercolor="#000000">
<%
for i=1 to pagenum
if not rs1.eof then
if trim(rs1("fukuan"))="欠款" then
moncount6=Csng(rs1("lirun1"))
moncount5=moncount5+moncount6
else
moncount3=Csng(rs1("lirun1"))
moncount2=moncount2+moncount3
end if
%>
<tr>
<td height="18" width="70"> <%=rs1("sellautoid")%></td>
<td height="18" width="168"><%=Decode(rs1("productname"))%> <%=rs1("productsize")%></td>
<td height="18" width="121"><%=left(rs1("gongshang"),9)%></td>
<td height="18" width="30" align="center"><%=rs1("productnum")%></td>
<td height="18" width="24" align="center"><%=rs1("productdan")%></td>
<td height="18" width="50" align="right"><%=formatNumber(rs1("chaoshi"),varnum,-1)%></td>
<td height="18" width="23" align="center"><%=rs1("youhui")%></td>
<td height="18" width="52" align="right"><%=formatNumber(rs1("productjia"),varnum,-1)%></td>
<td height="18" width="55" align="right"><%=formatNumber(rs1("moncount1"),varnum,-1)%></td>
<td height="18" width="45" align="right"><%=formatNumber(rs1("lirun1"),varnum,-1)%></td>
<td align="center" height="18" width="25"><%if trim(rs1("fukuan"))="欠款" then%><font color=blue><%=rs1("fukuan")%></font><%else%><%=rs1("fukuan")%><%end if%></td>
<td height="18" width="61"><%=rs1("indate")%></td>
</tr>
<%
rs1.movenext
end if
next
%>
</table>
<%
if not rs1.eof and i=pagenum+1 then '添加分页标记
%>
<div class="break"> </div>
<table border="0" cellpadding="0" cellspacing="0" width="740" height="12" align="center"><tr><td height="12"></td></tr></table>
<table border="1" cellspacing="0" cellpadding="0" align="center" width="740" style="border-collapse: collapse" bordercolor="#000000">
<tr>
<td align="center" height="20" bgcolor="#BDCBEE" width="70" >销售单号</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="168" >商品名称(规格)</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="121" >客户</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="30" >数量</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="24" >单位</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="50" >销售价</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="23" >折%</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="52" >进货价</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="55" >小计</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="45" >利润</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="25" >付款</td>
<td align="center" height="20" bgcolor="#BDCBEE" width="61" >销售日期</td>
</tr>
<%
end if
loop
rs1.close
set rs1=nothing
%>
</table>
<table border="1" cellpadding="0" cellspacing="0" width="740" height="20" align="center" style="border-collapse: collapse" bordercolor="#000000">
<tr>
<td><font color="#FF0000"><b>现金利润:</b></font><b><%=formatNumber(moncount2,varnum,-1)%></b> <%if moncount5<>"" then%><b><font color="#FF0000">欠款利润</font>:<%=formatNumber(moncount5,varnum,-1)%></b><%end if%> <%if moncount5<>"" then%><b><font color="#FF0000">毛利合计:</font><%=formatNumber(moncount5+moncount2,varnum,-1)%></b><%end if%></td>
</tr>
</table>
<%
end if
conn.close
set conn=nothing
%>
</BODY>
</HTML>


猜你喜欢
- 本文实例为大家分享了基于numpy实现逻辑回归的具体代码,供大家参考,具体内容如下交叉熵损失函数;sigmoid激励函数基于numpy的逻辑
- 统计十篇新闻TF-IDF统计TF-IDF词频,每篇文章的 top10 的高频词存储为 json 文件TF-IDFTF-IDF(term fr
- 为什么使用Python假设我们有这么一项任务:简单测试局域网中的电脑是否连通.这些电脑的ip范围从192.168.0.101到192.168
- 昨天碰到的,如果键是中文,如何进行匹配呢,先看文本内容: 这是字典里两个元素的内容,编码是utf-8,中文内容运行代码如下# -*- cod
- 做网站数据库,是选SQL Server还是Access好,可能您会说:选MySQL好,不过现在只是讨论IIS+ASP这种架构下的选择,不讨论
- 一、输入注入注入攻击非常广泛而且很常见,注入有很多种类,它们影响所有的语言、框架和环境。SQL 注入是直接编写 SQL 查询(而非使用 OR
- 1。下载mysql-noinstall-5.1.33-win32.zip,然后解压 2。复制my-huge配置文件为my.ini 在 [my
- 关于本文:本着互联网共享主义精神,特写此文献给建站新手,授人以鱼,不如授人以渔,本文所讲的只是方法和原理,希望大家看完此文,能够从中得到些帮
- SQL Server 2005的新功能为动态管理对象,它们是在指定时间返回某个数据库实例的特殊状态信息的数据库视图或函数。这些对象允许数据库
- 来源:http://stackoverflow.com/questions/3806562/ways-to-move-up-and-down
- 内容摘要:ASP开发人员为了在他们的设计项目中获得更好的性能和可扩展性而不断努力。幸运地是,有许多书籍和站点在这方面提供了很好的建议。但是这
- 针对之前安装mysql的笔记进行了总结,分享给大家。1.下载下载地址:http://dev.mysql.com/downloads/mysq
- 产品通常分两种,一种是遵循现有用户习惯,一种是颠覆用户习惯。至于什么是用户习惯,你现在用右手还是左手操作鼠标,这就是你的习惯。很多公司团队专
- 在同一个 Apache 实例中运行多个 Django 程序是完全可能的。 当你是一个独立的 Web 开发人员并有多个不同的客户时,你可能会想
- 检测对象中属性的存在与否可以通过几种方法来判断。 1.使用in关键字该方法可以判断对象的自有属性和继承来的属性是否存在。 var o={x:
- PHP中重定向网页跳转页面的方法(共三种)第一种:利用header()函数进行重定向,这也是我用的较多的。(注意!locationhe和“:
- mysql-5.7.23-winx64 解压版详细安装教程,供大家参考,具体内容如下1、Click here to download Mys
- 有一个同学在Gne的群里面咨询如何通过Selenium获取当前鼠标指向的元素,在我讲了方法以后,他过了两天又来问:那么,我今天就来写一篇文章
- 目前已经有很多生成html的新闻系统,但是都是用的模板,本函数实现把asp页面产生的html代码保存成为一个html文件,这样就没有必要改动
- 现在需要一个写文件方法,将selenium的脚本运行结果写入test_result.log文件中首先创建写入方法def write_resu