查看: 1756|回复: 1

[问与答] 求助:订单数据 横向重复区域的问题请教!!!!

[复制链接]
树枝孤鸟 发表于 2019-4-24 16:06:11 | 显示全部楼层 |阅读模式
本帖最后由 树枝孤鸟 于 2019-4-24 16:06 编辑

现在的代码是把多张订单的数据合并在一起展示,而不是按每张订单的内容分开展示,附件中的代码要如何修改才能达到蓝色字体图中的展示效果?!谢谢!!!
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="../Connections/dswl.asp" -->
  3. <%
  4. Dim Recordset1__khid
  5. Recordset1__khid = "1"
  6. If (Request.form("ID") <> "") Then
  7.   Recordset1__khid = Request.form("ID")
  8. End If
  9. %>
  10. <%
  11. Dim Recordset1__rq
  12. Recordset1__rq = "a1"
  13. If (Request.form("date") <> "") Then
  14.   Recordset1__rq = Request.form("date")
  15. End If
  16. %>
  17. <%
  18. Dim Recordset1
  19. Dim Recordset1_cmd
  20. Dim Recordset1_numRows

  21. Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
  22. Recordset1_cmd.ActiveConnection = MM_dswl_STRING
  23. 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"
  24. Recordset1_cmd.Prepared = true
  25. Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 200, 1, 255, Recordset1__khid) ' adVarChar
  26. Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param2", 200, 1, 255, Recordset1__rq) ' adVarChar

  27. Set Recordset1 = Recordset1_cmd.Execute
  28. Recordset1_numRows = 0
  29. %>
  30. <%
  31. Dim Repeat1__numRows
  32. Dim Repeat1__index

  33. Repeat1__numRows = -1
  34. Repeat1__index = 0
  35. Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
  36. %>

  37. <script language=javascript>   
  38. function doPrint() {   
  39. bdhtml=window.document.body.innerHTML;   
  40. sprnstr="<!--startprint-->";   
  41. eprnstr="<!--endprint-->";   
  42. prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);   
  43. prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));   
  44. window.document.body.innerHTML=prnhtml;   
  45. window.print();   
  46. }   
  47. </script>
  48. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  49. <html>
  50. <head>
  51. <META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
  52. href="../ztys/DefaultSkin.css" type=text/css
  53. rel=stylesheet>
  54. <SCRIPT language=JavaScript src="../ztys/menu.js"
  55. type=text/JavaScript></SCRIPT>

  56. <META content="MSHTML 6.00.2800.1106" name=GENERATOR>
  57. <style type="text/css">
  58. <!--
  59. body {
  60.         margin-left: 0px;
  61.         margin-top: 0px;
  62.         background-image: url(../images/pagebj.jpg);
  63. }
  64. .style32 {color: #FF0000}
  65. .style38 {font-size: larger; color: #FF0000; }
  66. .style39 {color: #0000FF}
  67. .style40 {color: #000000}
  68. .STYLE43 {
  69.         font-size: 100%;
  70.         color: #0000FF;
  71.         font-weight: bold;
  72.         font-family: "幼圆";
  73. }
  74. -->
  75. </style>
  76. <title>手工烟指引单</title>
  77. </head>
  78. <%
  79. set conn=server.createobject("adodb.connection")
  80. conn.open MM_dswl_STRING
  81. %>
  82. <body>
  83. <table width="650" height="230">
  84.   <tr background="../images/pagebj.jpg">
  85.     <td height="22">&nbsp;</td>
  86.     <td bordercolor="#FFFFFF"><div align="right">
  87.     <input type=button name=button_print value=" 打    印 " onclick="javascript:doPrint()">&nbsp;&nbsp;<a href="zc_v_hand_dy.asp"><span class="style23">返回首页</span></a> &nbsp;</div></td>
  88.   </tr>
  89.   <tr background="../images/pagebj.jpg">
  90.     <td height="200" colspan="2"><!--startprint-->
  91.       <table width="635">
  92.       <tr>
  93.         <td><div align="center"><p class="style11">手工烟指引单</p>
  94.         </div></td>
  95.       </tr>
  96.       <tr>
  97.         <td background="../images/pagebj.jpg"><table width="635" cellspacing="1" bgcolor="#000000">
  98.           <tr bordercolor="#666666" bgcolor="#FFFFFF" background="../images/pagebj.jpg">
  99.             <td width="200"><div align="center" class="style14"><%= Request.Form("DATE") %></div></td>
  100.             <td width="250"><div align="center" class="style14"><%=(Recordset1.Fields.Item("SEG_NAME").Value)%></div></td>
  101.             <td width="250"><div align="center" class="style14">[<%=(Recordset1.Fields.Item("DIL_CODE").Value)%>]<%=(Recordset1.Fields.Item("DIL_NAME").Value)%></div></td>
  102.           </tr>
  103.         </table></td>
  104.       </tr>
  105.       <tr>
  106.         <td><table width="635" cellspacing="1" bgcolor="#000000">
  107.           <% i=1 %>
  108.           <tr bgcolor="#FFFFFF">
  109.             <td bordercolor="#666666"><p align="left" class="style14"><strong><%= i %>
  110.                   <%i=i+1  %>
  111.               、[<span class="style39"><%=(Recordset1.Fields.Item("CUSTOM_CODE").Value)%></span>]<%=(Recordset1.Fields.Item("CUSTOM_NAME").Value)%><br>
  112.               【订单<span class="style39"><%=(Recordset1.Fields.Item("ORDER_NO").Value)%></span>&nbsp;&nbsp;数量<span class="style38"><%=(Recordset1.Fields.Item("ORD_QTY").Value)%></span>条&nbsp;&nbsp;金额<span class="style38"><%=(Recordset1.Fields.Item("ORD_MONEY").Value)%></span>元</strong><strong>】</strong></p>
  113.               
  114.   <table width="217" border="0">
  115.     <tr><%no=Recordset1.Fields.Item("order_no").Value%>
  116.       <%
  117. exec="select order_no,item_name,item_qty from dbo.V_ORDER_HAND_DETAIL WHERE order_no='"&no&"' ORDER BY item_name"
  118. set rs=server.createobject("adodb.recordset")
  119. rs.open exec,conn,1,1
  120. %>
  121. <%
  122. While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
  123. %>
  124.      
  125.       <td width="207"><table width="196" border="0">
  126.         <tr>
  127.           <td width="174">[<%=(Recordset1.Fields.Item("ITEM_QTY").Value)%>]<%=(Recordset1.Fields.Item("ITEM_NAME").Value)%></td>
  128.         </tr>
  129.       </table></td>
  130.     <%

  131. num_tr=num_tr+1

  132. if num_tr mod 3=0 then

  133. response.write"</tr><tr>"

  134. end if

  135. %>
  136.   <%
  137.   Repeat1__index=Repeat1__index+1
  138.   Repeat1__numRows=Repeat1__numRows-1
  139.   Recordset1.MoveNext()
  140. Wend
  141. %></tr>
  142.   </table>
  143.               <p align="left" class="style14"><span class="style21"><br>
  144.               </span></p></td>
  145.             
  146.           </table></td>
  147.       </tr>
  148.     </table>
  149.     <!--endprint--></td>
  150.   </tr>
  151. </table>
  152. </body>
  153. </html>
  154. <%
  155. Recordset1.Close()
  156. Set Recordset1 = Nothing
  157. %>
复制代码

希望达到的效果

希望达到的效果

附件代码的展示效果

附件代码的展示效果

代码.rar

2.14 KB, 下载次数: 1, 下载积分: 威望 1 个

ttasp 发表于 2019-4-25 11:27:58 | 显示全部楼层
完整代码发邮箱support@ttasp.COM
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号