SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP Classic nested repeat region and horizontal looper

    I'm having problems getting expected results while morphing a nested repeat region and horizontal looper. Maybe someone has run into this or maybe I'm missing the target altogether. Any suggestions?

    Thanks!

    Expected results:
    GROUP A (from recordset rsMaster)
    GROUPA.Item1 GROUPA.Item2 GROUPA.Item3 GROUPA.Item4
    GROUPA.Item5 GROUPA.Item6 GROUPA.Item7..etc
    GROUP B (from recordset rsMaster)
    GROUPB.Item1 GROUPB.Item2 GROUPB.Item3 GROUPB.Item4
    GROUPB.Item5 GROUPB.Item6 GROUPB.Item7..etc
    GROUP C (from recordset rsMaster)
    GROUPC.Item1 GROUPC.Item2 GROUPC.Item3 GROUPC.Item4
    GROUPC.Item5 GROUPC.Item6 GROUPC.Item7..etc


    Actual Results
    GROUP A (all items from all groups display under GROUP A)
    Item1 Item2 Item3 Item4
    Item5 Item6 Item7..etc
    GROUP B
    no results
    GROUP C
    no results
    GROUP D
    no results
    GROUP E
    no results
    etc.


    Code:
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index
    
    Repeat1__numRows = -1
    Repeat1__index = 0
    rsMaster_numRows = rsMaster_numRows + Repeat1__numRows
    %>
    <%
    Dim HLooper1__numRows
    HLooper1__numRows = -4
    Dim HLooper1__index
    HLooper1__index = 0
    rsSlave_numRows = rsSlave_numRows + HLooper1__numRows
    %>
    <html>
    <body>
     <% 
    While ((Repeat1__numRows <> 0) AND (NOT rsMaster.EOF)) 
    %>
    <table>
    <tr>
    <td><%=(rsMaster.Fields.Item("TPD").Value)%></td>
    </tr>
    <tr>
    <td>
    <%
    FilterParam = (rsMaster.Fields.Item("TPD").Value)
    rsSlave.Filter = "TPD =  " & FilterParam
    While (NOT rsSlave.EOF)
    %>
    <table>
    <%
    startrw = 0
    endrw = HLooper1__index
    numberColumns = 4
    numrows = -1
    while((numrows <> 0) AND (Not rsSlave.EOF))
    	startrw = endrw + 1
    	endrw = endrw + numberColumns
     %>
    <tr>
    <%
    While ((startrw <= endrw) AND (Not rsSlave.EOF))
    %>
    <td>
    <table>
    <tr>
    <td>
    <img src="<%=(rsSlave.Fields.Item("Thumb").Value)%>"><br>
    <%=(rsSlave.Fields.Item("ItemNo").Value)%>
    </td>
    </tr>
    </table></td>
    <%
    	startrw = startrw + 1
    	rsSlave.MoveNext()
    	Wend
    	%>
    </tr>
    <%
     numrows=numrows-1
     Wend
     %>
    </table>
    <%
    rsSlave.MoveNext()
    Wend
    %>
    
    </td>
    </tr>
    </table>
    <% 
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      rsMaster.MoveNext()
    Wend
    %>
    </body>
    </html>

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not the whole code, is it ? To check this, we will need to know your db table data and sql statements;

    Show some more details, like where the recordsets are loaded etc...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •