?? show_report_sellbyproduct01.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 * from sell where (sellCreatorID="&session("Session_User")&"or sellopenflag='1' ) "&textsql
sql=sql&" order by sellproduct,selldate"
%>
<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=22
rs.AbsolutePage=page
pcount = rs.pagecount
'獲取上一頁的最后一個記錄的sellclientid
rs.moveprevious
if not rs.bof then
last_id=(rs("sellproduct"))
end if
rs.movenext
for i=1 to rs.pagesize
if rs.eof then exit for
if rs("sellproduct")<>last_id then
%>
<!-- 顯示客戶-->
<tr bgcolor="#E8E8E8">
<td width="30%" height="25" valign="bottom" align="center" colspan="4"><strong><%=rs("sellproduct")%></strong></td>
</tr>
<!-- 顯示客戶購買的產品-->
<tr >
<td align="center" colspan="4">
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5" height="5"></td>
</tr>
<tr>
<td width="20%"><strong>銷售日期</strong></td>
<td width="30%"><strong>銷售主題</strong></td>
<td width="15%"><div align="right"><strong>單價</strong></div></td>
<td width="15%"><div align="right"><strong>數量</strong></div></td>
<td><div align="right"><strong>金額</strong></div></td>
</tr>
<tr>
<td colspan="5" ><img src="../images/hr.gif" width="100%"height="1"></td>
</tr>
<tr>
<td height="25" width="20%"><%=rs("selldate")%></td>
<td height="25" width="30%"><%=rs("Selltopic")%></td>
<td width="15%"><div align="right"><%=rs("SellProductprice")%></div></td>
<td width="15%"><div align="right"><%=rs("SellProductnum")%></div></td>
<td><div align="right"><%=rs("Sellmoney")%></div></td>
</tr>
</table>
</td>
</tr>
<%else%>
<tr>
<td align="center" colspan="4">
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" width="20%"><%=rs("selldate")%></td>
<td height="25" width="30%"><%=rs("Selltopic")%></td>
<td width="15%"><div align="right"><%=rs("SellProductprice")%></div></td>
<td width="15%"><div align="right"><%=rs("SellProductnum")%></div></td>
<td><div align="right"><%=rs("Sellmoney")%></div></td>
</tr>
</table>
</td>
</tr>
<%end if%>
<%
if rs.eof then exit for
last_id=rs("sellproduct")
rs.movenext
if rs.eof then
lastflag=1
else
if rs("sellproduct")<>last_id then
lastflag=1
else
lastflag=0
end if
end if
if (lastflag=1) then
%>
<tr>
<td align="center" colspan="4">
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" colspan="2"></td><td colspan="3" align="left" ><img src="../images/hr.gif" width="100%" height="1"></td>
</tr>
<tr>
<td height="25" colspan="3" width="65%"></td>
<td width="15%"><div align="right"><strong>小計:</strong></div></td>
<td><div align="right"><strong><%= showsellsum_p(last_id)%></strong></div></td>
</tr>
</table>
</td>
</tr>
<%
end if
next
'補足后面的空格
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 + -