⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 down_report_sellbyproduct.asp

📁 Activity——活动管理模块 Analyse——分析模块 Client——客户管理系统模块 Email——E-mail管理模块 Fee——费用管理模块 Report——报表模块 Sel
💻 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 sellproduct,selldate"

'创建文件名
strFileName = "r_sellbyproduct_" & 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
''判断数据集是否为空
   if not rs.eof then   
   ''利用for循环将记录写入文件中
   for i=1 to intRC
       if rs.eof then exit for 
       if rs("sellproduct")<>last_id then 
        strLineString=(rs("sellproduct"))&",,,"
objNewsFile.writeline(strLineString)
        strLineString= ",销售日期,产品名称,单价,数量,金额"
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("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 
        strLineString= ",,,,小计:,"& showsellsum_p(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>下载销售查询结果数据</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 + -