?? down_report_sellbyclient.asp
字號:
<!--#INCLUDE file="../pub_fun.asp"-->
<!--#INCLUDE FILE="../conn.asp"-->
<html>
<HEAD>
<META NAME="Keywords" CONTENT="FastReport"/>
<META NAME="Description" CONTENT="The FastReport report"/>
<LINK href="../css.css" rel="stylesheet" type="text/css" media="all">
<title>銷售信息查詢結果下載(按照客戶)</title>
</head>
<body >
<%
''獲取查詢語句
textSql=decrypt(trim(request("sql")))
'組成查詢語句
sql="select * from sell where (sellCreatorID="&session("Session_User")&"or sellopenflag='1' ) "&textsql
sql=sql&" order by sellclientid,selldate"
'創(chuàng)建文件名
strFileName = "r_sellbyclient_" & GetAutoID() & ".csv"
strFullFileName = server.mappath("../data/" & strFileName) '帶路徑
'創(chuàng)建文件對象
SET objMyFile = Server.Createobject("scripting.filesystemobject")
SET objNewsFile = objMyFile.createtextfile(strFullFileName)
'創(chuàng)建數(shù)據(jù)集對象
SET Rs = Server.CreateObject("Adodb.RecordSet")
Rs.Open Sql,conn,3
intRC = Rs.RecordCount
'判斷數(shù)據(jù)計是否為空
if not rs.eof then
'如果不為空則將數(shù)據(jù)寫入文件
for i=1 to intRC
if rs.eof then exit for
if rs("sellclientid")<>last_id then
strLineString=showclientname(rs("sellclientid"))&",,,"
objNewsFile.writeline(strLineString)
strLineString= ",銷售日期,產品名稱,單價,數(shù)量,金額"
objNewsFile.writeline(strLineString)
strLineString=","&rs("Selldate")&","&rs("SellProduct")&","
strLineString= strLineString&rs("SellProductprice")&","
strLineString= strLineString&rs("SellProductnum")&","
strLineString= strLineString&rs("Sellmoney")
objNewsFile.writeline(strLineString)
else
strLineString=","&rs("Selldate")&","&rs("SellProduct")&","
strLineString= strLineString&rs("SellProductprice")&","
strLineString= strLineString&rs("SellProductnum")&","
strLineString= strLineString&rs("Sellmoney")
objNewsFile.writeline(strLineString)
end if
if rs.eof then exit for
last_id=rs("sellclientid")
rs.movenext
if rs.eof then
lastflag=1
else
if rs("sellclientid")<>last_id then
lastflag=1
else
lastflag=0
end if
end if
if (lastflag=1) then
strLineString= ",,,,小計:,"& showsellsum_c(last_id)
objNewsFile.writeline(strLineString)
end if
next
end if
Rs.Close
SET Rs = NOTHING
objNewsFile.close
SET objNewsFile = NOTHING
SET objMyFile = NOTHING
%>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" width="380" height="207">
<tr class="CListTTL" >
<td height="29" ><font color = yellow ><b>下載銷售查詢結果數(shù)據(jù)</b></FONT></td>
</tr>
<tr CLASS=cROW>
<td width="100%" height="177">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="72%" id="AutoNumber2">
<tr align="center" CLASS=cROW>
<td nowrap><a href="../data/<%=strFileName%>" onMouseDown="javascript:if (event.button==1) alert('請用鼠標右鍵點擊鏈接\n選擇目標另存為!')"><font color=blue><strong>下 載</strong></font></a></td>
</tr>
<tr align="center" CLASS=cROW>
<td nowrap><br><br><br><font color = red>說明:用鼠標右鍵點擊“下載”,選擇“目標另存為...”功能</font></td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</center>
</div>
</BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -