If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Easy One - Record Set Output, but not paged - output to all one page.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-04, 22:45
PaulGQ PaulGQ is offline
Registered User
 
Join Date: Feb 2002
Posts: 23
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.
Reply With Quote
  #2 (permalink)  
Old 04-19-04, 09:40
ASP-Hosting.ca ASP-Hosting.ca is offline
Registered User
 
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>
Reply With Quote
  #3 (permalink)  
Old 04-19-04, 10:39
thele thele is offline
Registered User
 
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:
Quote:
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
Reply With Quote
  #4 (permalink)  
Old 04-19-04, 10:51
PaulGQ PaulGQ is offline
Registered User
 
Join Date: Feb 2002
Posts: 23
Any idea of the nested loop syntax?
Reply With Quote
  #5 (permalink)  
Old 04-19-04, 12:57
thele thele is offline
Registered User
 
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>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On