lshane
asked on
Nested Repeat Region - ASP VBScript - Dreamweaver MX
Hello. I am using Dreamweaver MX with ASP VBScript (not .NET).
I am trying to create a Nested Repeat Region for a couple of tables: <products> <productchampions>
(The "product champion" is the expert of a particular product).
Their field layouts are:
<products> {prodNumb, prodName, pcID}
<productchampions> {pcID, pcFirstName, pcLastName}
I can create a "repeating region" to pull the "pcLastName" and "prodNumb", but it will list the name on every row of the product numbers. Example below:
Last Name: Product Number
Last Name: Product Number
Last Name: Product Number
Last Name: Product Number
I am trying to get it to only display the last name once, and then list all associated product numbers. When it has reached the end of all its related product numbers, it will move to the next Last Name and display all of those related product numbers. Example below:
Last Name: Product Number
Product Number
Product Number
Product Number
Last Name: Product Number
Product Number
Product Number
Product Number
Could someone, please, help me accomplish this? This is for my team at work.
Thank you,
lshane
I am trying to create a Nested Repeat Region for a couple of tables: <products> <productchampions>
(The "product champion" is the expert of a particular product).
Their field layouts are:
<products> {prodNumb, prodName, pcID}
<productchampions> {pcID, pcFirstName, pcLastName}
I can create a "repeating region" to pull the "pcLastName" and "prodNumb", but it will list the name on every row of the product numbers. Example below:
Last Name: Product Number
Last Name: Product Number
Last Name: Product Number
Last Name: Product Number
I am trying to get it to only display the last name once, and then list all associated product numbers. When it has reached the end of all its related product numbers, it will move to the next Last Name and display all of those related product numbers. Example below:
Last Name: Product Number
Product Number
Product Number
Product Number
Last Name: Product Number
Product Number
Product Number
Product Number
Could someone, please, help me accomplish this? This is for my team at work.
Thank you,
lshane
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi, RaheelHannan. That worked great. Thank you so much. I appreciate it.
Nested Repeat Regions in Dreamweaver MX
Looks like Ash's solution worked well for Ishane.
I simply wonder if a similar solution is available in PHP as well?
cgustaf
Looks like Ash's solution worked well for Ishane.
I simply wonder if a similar solution is available in PHP as well?
cgustaf
<table>
<%
Dim strConn : strConn = "Provider=MSDataShape;Data
Dim strSql : strSql = "SHAPE{SELECT pcID, pcLastName FROM productchampions ORDER BY pcLastName} " & _
"APPEND({SELECT pcID, prodNumb} AS rs2 " & _
"RELATE pcID TO pcID)"
dim rs : Set rs = Server.CreateObject("ADODB
rs.Open strSql, strConn
Do While Not rs.EOF
Set rs2 = rs("rs2").Value
%>
<tr>
<td valign="top"><%= rs("pcLastName") %></td>
<td>
%>
Do While Not rs2.EOF
Response.Write rs2("prodNumb") &"<br />"
rs2.movenext
Loop
<%
</td>
</tr>
<%
rs.movenext
Loop
rs.close
Set rs2 = Nothing
Set rs = Nothing
%>
</table>