?? show_report_sellsumproduct01.asp
字號:
<!--#include file="../conn.asp"-->
<!--#include file="../isuser.asp"-->
<!--#include file="../pub_fun.asp"-->
<META NAME="Keywords" CONTENT="FastReport"/>
<META NAME="Description" CONTENT="The FastReport report"/>
<LINK href="../css.css" rel="stylesheet" type="text/css" media="all">
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<body>
<form name="form1">
</form>
<%
''獲取傳遞過來的查詢條件
textsql=decrypt(request("textsql"))
''獲取傳遞過來的頁面數
if request("movepage")<>"" then
page=cint(request("movepage"))
else
page=1
end if
'' 組合成相應的查詢語句
sql="SELECT SellProduct,MAX(SellProductprice) AS sellproductprice, sum(SellProductnum) AS SellProductnum, sum(Sellmoney) AS sellmoney"
sql=sql&" from sell"
sql=sql&" where (sellCreatorID="&session("Session_User")&"or sellopenflag='1' ) "&textsql
sql=sql&"GROUP BY SellProduct"
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td colspan="4" height="25" valign="top"><div align="left"><strong><font color="#3399FF" size="3">產品銷售匯總表</font></strong></div></td>
</tr>
<tr>
<td colspan="4" align="center" height="2">
<hr align="left" size="2" color="#000000" width="99%" >
</td>
</tr>
<%
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,3
if not rs.eof then
rs.pagesize=30
rs.AbsolutePage=page
pcount = rs.pagecount
%>
<tr >
<td align="center" colspan="4">
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="6" height="5"></td>
</tr>
<tr>
<td width="5%"></td>
<td width="35%"><strong>產品名稱</strong></td>
<td width="20%"><div align="right"><strong>單價(最高)</strong></div></td>
<td width="20%"><div align="right"><strong>數量</strong></div></td>
<td><div align="right"><strong>金額</strong></div></td>
<td width="5%"></td>
</tr>
<tr>
<td colspan="6" ><img src="../images/hr.gif" width="100%"height="1"></td>
</tr>
<%
for i=1 to rs.pagesize
if rs.eof then exit for
%>
<tr>
<td width="5%"></td>
<td height="25" width="35%"><%=rs("SellProduct")%></td>
<td width="20%"><div align="right"><%=rs("SellProductprice")%></div></td>
<td width="20%"><div align="right"><%=rs("SellProductnum")%></div></td>
<td><div align="right"><%=rs("Sellmoney")%></div></td>
<td width="5%"></td>
</tr>
<%
if rs.eof then exit for
rs.movenext
next
%>
</table>
</td>
</tr>
<%
if page=pcount then
%>
<tr>
<td align="center" colspan="4">
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%" ></td><td colspan="3" align="left" ><img src="../images/hr.gif" width="100%" height="1"></td>
</tr>
<tr>
<td height="25" width="40%"></td>
<td width="20%"><div align="right"><strong>總計:</strong></div></td>
<td width="20%"><div align="right"><strong><%= showselltotalsum%></strong></div></td>
<td><div align="right"><strong><%= showselltotalmoney%></strong></div></td>
<td width="5%"></td>
</tr>
</table>
</td>
</tr>
<%
end if
'補足后面的空格
if i<rs.pagesize then
for j=i to rs.pagesize-1
response.Write("<tr><td height=40></td></tr>")
next
end if
else
response.Write("<tr><td height=30>沒有紀錄!</td></tr>")
end if
%>
<tr>
<td colspan="4" height="5"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<hr align="left" size="2" color="#000000" width="99%" >
</td>
</tr>
<tr>
<td width="95%"><div align="left"><%=date()%></div></td>
<td><div align="left"><%=page%>/<%=pcount%></div></td>
</tr>
</table></td>
</tr>
</table>
</BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -