📄 down_report_sellsumproduct.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 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"
'创建文件名
strFileName = "r_sellsumproduct_" & GetAutoID() & ".csv"
strFullFileName = server.mappath("../data/" & strFileName) '带路径
SET objMyFile = Server.Createobject("scripting.filesystemobject")
SET objNewsFile = objMyFile.createtextfile(strFullFileName)
SET Rs = Server.CreateObject("Adodb.RecordSet")
'从数据库中读出数据
Rs.Open Sql,conn,3
intRC = Rs.RecordCount
'写入标题
strLineString= "产品名称,单价,数量,金额"
objNewsFile.writeline(strLineString)
if not rs.eof then
''利用for循环将数据写入文件
for i=1 to intRC
if rs.eof then exit for
strLineString=rs("SellProduct")&","
strLineString= strLineString&rs("SellProductprice")&","
strLineString= strLineString&rs("SellProductnum")&","
strLineString= strLineString&rs("Sellmoney")
objNewsFile.writeline(strLineString)
if rs.eof then exit for
rs.movenext
next
''记录的最后些总计
strLineString= ",总计:,"& showselltotalsum&","&showselltotalmoney
objNewsFile.writeline(strLineString)
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>下载销售查询结果数据</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 + -