Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2002
    Posts
    23

    Unanswered: Easy One - Record Set Output, but not paged - output to all one page.

    OK here is it. My recordset is 52 rows long.

    I want to limit the output to 13 rows, then not page, but continue as columns in a table.

    This will give my singe page one table with 4 columns - 13 rows in each column, not 4 pages of recordset data.

    I know this can easily be done, but I can't figure out how.

  2. #2
    Join Date
    Apr 2004
    Posts
    50
    You can do this with 2 nested loops, displaying something like:

    Code:
    <table>
      <tr>
        <td>
          <table>
             <tr><td>Row1</td></tr>
             <tr><td>Row2</td></tr>
             .......
             <tr><td>Row13</td></tr>
          </table>
        </td>
        <td>
          <table>
             <tr><td>Row14</td></tr>
             <tr><td>Row15</td></tr>
             .......
             <tr><td>Row26</td></tr>
          </table>
          .........
              <td>
          <table>
             <tr><td>Row40</td></tr>
             <tr><td>Row41</td></tr>
             .......
             <tr><td>Row52</td></tr>
          </table>
        </td>
        </td>
      </tr>
    </table>

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    108
    Yeah, it's going to take some hideous code, but ASP-Hosting.ca is right.

    Alternatively what you can do is add 13 to your loop. It is easier if you put the recordset into an array first. Here is basically what it would look like:

    Pseudo code:
    RSarray = Recordset.getrows
    For z = 0 to ubound(RSarray,2)
    &nbsp;&nbsp;<td>Column1 = RSarray(0,z) </td>
    &nbsp;&nbsp;<td>Column2 = RSarray(0,z+13) </td>
    &nbsp;&nbsp;<td>Column3 = RSarray(0,z+26) </td>
    Next
    You need to make sure that z+13 is not greater than ubound(RSarray,2), but you should be able to figure out that code (if you can't then you need to go back to school).

    ~Le

  4. #4
    Join Date
    Feb 2002
    Posts
    23
    Any idea of the nested loop syntax?

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    108
    <table>
    &nbsp;&nbsp;<tr>
    &nbsp;&nbsp;<%'column 1%>
    &nbsp;&nbsp;&nbsp;&nbsp;<Td>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%'--loop 0-12%>
    &nbsp;&nbsp;&nbsp;&nbsp;</td>
    &nbsp;&nbsp;<%'column 2%>
    &nbsp;&nbsp;&nbsp;&nbsp;<Td>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%'--loop 13-25%>
    &nbsp;&nbsp;&nbsp;&nbsp;</td>
    &nbsp;&nbsp;<%'column 3%>
    &nbsp;&nbsp;&nbsp;&nbsp;<Td>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%'--loop 26+%>
    &nbsp;&nbsp;&nbsp;&nbsp;</td>
    &nbsp;&nbsp;</tr>
    </table>

Posting Permissions

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