|
本帖最后由 树枝孤鸟 于 2019-4-24 16:06 编辑
现在的代码是把多张订单的数据合并在一起展示,而不是按每张订单的内容分开展示,附件中的代码要如何修改才能达到蓝色字体图中的展示效果?!谢谢!!!
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
- <!--#include file="../Connections/dswl.asp" -->
- <%
- Dim Recordset1__khid
- Recordset1__khid = "1"
- If (Request.form("ID") <> "") Then
- Recordset1__khid = Request.form("ID")
- End If
- %>
- <%
- Dim Recordset1__rq
- Recordset1__rq = "a1"
- If (Request.form("date") <> "") Then
- Recordset1__rq = Request.form("date")
- End If
- %>
- <%
- Dim Recordset1
- Dim Recordset1_cmd
- Dim Recordset1_numRows
- Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
- Recordset1_cmd.ActiveConnection = MM_dswl_STRING
- Recordset1_cmd.CommandText = "SELECT order_date,seg_name,dil_code,dil_name,custom_code,custom_name,order_no,ORD_QTY,ORD_MONEY,ITEM_QTY,ITEM_NAME FROM dbo.v_order_hand_DETAIL WHERE (DIL_CODE=?)AND(ORDER_DATE=?) group by order_date,seg_name,dil_code,dil_name,CUSTOM_SID,custom_code,custom_name,order_no,ORD_QTY,ORD_MONEY,ITEM_QTY,ITEM_NAME ORDER BY CUSTOM_SID"
- Recordset1_cmd.Prepared = true
- Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 200, 1, 255, Recordset1__khid) ' adVarChar
- Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param2", 200, 1, 255, Recordset1__rq) ' adVarChar
- Set Recordset1 = Recordset1_cmd.Execute
- Recordset1_numRows = 0
- %>
- <%
- Dim Repeat1__numRows
- Dim Repeat1__index
- Repeat1__numRows = -1
- Repeat1__index = 0
- Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
- %>
- <script language=javascript>
- function doPrint() {
- bdhtml=window.document.body.innerHTML;
- sprnstr="<!--startprint-->";
- eprnstr="<!--endprint-->";
- prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
- prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
- window.document.body.innerHTML=prnhtml;
- window.print();
- }
- </script>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
- href="../ztys/DefaultSkin.css" type=text/css
- rel=stylesheet>
- <SCRIPT language=JavaScript src="../ztys/menu.js"
- type=text/JavaScript></SCRIPT>
- <META content="MSHTML 6.00.2800.1106" name=GENERATOR>
- <style type="text/css">
- <!--
- body {
- margin-left: 0px;
- margin-top: 0px;
- background-image: url(../images/pagebj.jpg);
- }
- .style32 {color: #FF0000}
- .style38 {font-size: larger; color: #FF0000; }
- .style39 {color: #0000FF}
- .style40 {color: #000000}
- .STYLE43 {
- font-size: 100%;
- color: #0000FF;
- font-weight: bold;
- font-family: "幼圆";
- }
- -->
- </style>
- <title>手工烟指引单</title>
- </head>
- <%
- set conn=server.createobject("adodb.connection")
- conn.open MM_dswl_STRING
- %>
- <body>
- <table width="650" height="230">
- <tr background="../images/pagebj.jpg">
- <td height="22"> </td>
- <td bordercolor="#FFFFFF"><div align="right">
- <input type=button name=button_print value=" 打 印 " onclick="javascript:doPrint()"> <a href="zc_v_hand_dy.asp"><span class="style23">返回首页</span></a> </div></td>
- </tr>
- <tr background="../images/pagebj.jpg">
- <td height="200" colspan="2"><!--startprint-->
- <table width="635">
- <tr>
- <td><div align="center"><p class="style11">手工烟指引单</p>
- </div></td>
- </tr>
- <tr>
- <td background="../images/pagebj.jpg"><table width="635" cellspacing="1" bgcolor="#000000">
- <tr bordercolor="#666666" bgcolor="#FFFFFF" background="../images/pagebj.jpg">
- <td width="200"><div align="center" class="style14"><%= Request.Form("DATE") %></div></td>
- <td width="250"><div align="center" class="style14"><%=(Recordset1.Fields.Item("SEG_NAME").Value)%></div></td>
- <td width="250"><div align="center" class="style14">[<%=(Recordset1.Fields.Item("DIL_CODE").Value)%>]<%=(Recordset1.Fields.Item("DIL_NAME").Value)%></div></td>
- </tr>
- </table></td>
- </tr>
- <tr>
- <td><table width="635" cellspacing="1" bgcolor="#000000">
- <% i=1 %>
- <tr bgcolor="#FFFFFF">
- <td bordercolor="#666666"><p align="left" class="style14"><strong><%= i %>
- <%i=i+1 %>
- 、[<span class="style39"><%=(Recordset1.Fields.Item("CUSTOM_CODE").Value)%></span>]<%=(Recordset1.Fields.Item("CUSTOM_NAME").Value)%><br>
- 【订单<span class="style39"><%=(Recordset1.Fields.Item("ORDER_NO").Value)%></span> 数量<span class="style38"><%=(Recordset1.Fields.Item("ORD_QTY").Value)%></span>条 金额<span class="style38"><%=(Recordset1.Fields.Item("ORD_MONEY").Value)%></span>元</strong><strong>】</strong></p>
-
- <table width="217" border="0">
- <tr><%no=Recordset1.Fields.Item("order_no").Value%>
- <%
- exec="select order_no,item_name,item_qty from dbo.V_ORDER_HAND_DETAIL WHERE order_no='"&no&"' ORDER BY item_name"
- set rs=server.createobject("adodb.recordset")
- rs.open exec,conn,1,1
- %>
- <%
- While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
- %>
-
- <td width="207"><table width="196" border="0">
- <tr>
- <td width="174">[<%=(Recordset1.Fields.Item("ITEM_QTY").Value)%>]<%=(Recordset1.Fields.Item("ITEM_NAME").Value)%></td>
- </tr>
- </table></td>
- <%
- num_tr=num_tr+1
- if num_tr mod 3=0 then
- response.write"</tr><tr>"
- end if
- %>
- <%
- Repeat1__index=Repeat1__index+1
- Repeat1__numRows=Repeat1__numRows-1
- Recordset1.MoveNext()
- Wend
- %></tr>
- </table>
- <p align="left" class="style14"><span class="style21"><br>
- </span></p></td>
-
- </table></td>
- </tr>
- </table>
- <!--endprint--></td>
- </tr>
- </table>
- </body>
- </html>
- <%
- Recordset1.Close()
- Set Recordset1 = Nothing
- %>
复制代码 |
-
希望达到的效果
-
附件代码的展示效果
-
-
代码.rar
2.14 KB, 下载次数: 1, 下载积分: 威望 1 个
|