Solved

Count Recordset Rows in Array to Force Page Break in HTML

Posted on 2001-06-22
2
355 Views
Last Modified: 2012-06-27
I am trying to write an array out to an HTML table by counting the rows in an Array created by using GetRows, and after 30 rows of I want to insert a page break, and write out the page title and table headers on the next page and then continue writing out another 30 records... until the end of the recordset. I cannot figure out how to insert the loop to count the records. Please help.. Below is the code I have...


<%'--Array ColRows is Defined Here---------------------------%>
<%ColRows = Array("EmpNo","FullName","Status","Birthdate","Location","FixJobNo","CostCen")%>

<%'-------Get Array using GetRows---------------------------%>

<%NumOfRecs=RS.Recordcount%>
<%ReturnedRows=RS.GetRows(NumOfRecs,,ColRows)%>
<%nRow=UBound(ReturnedRows,2)%>


<%'----Write out the Page Header and table header values---%>

<%Response.Write "<h1 align=""center""><font face=""arial"" size =""4"">&nbsp;Birthday Roster For " & objReportInfo.ForminputA & " In LOC " & objReportInfo.FormInputB & " Sorted By " & objReportInfo.FormInputC &"<br>"& XCount & " Associates Found" &"</font>"&"</h1>"%>
<%Response.Write "<DIV Align=""Center""><table border=1 style=""font-family: Arial; font-size: 8pt; text-align: Center"" cellspacing=0><th>Emp No</th><th>Associate Name</th><th>Status</th><th>BirthDate</th><th>Location</th><th>LOC</th><th><center>Cost Center</center></th></DIV>"%>

<%'----Write out the Array ColRows ---------------%>

<%'---How can I write out only 30 rows and after 30 rows print page header and table header---%>
<%'---after a page break ?--%>

<%for row = 0 to nRow%>
<tr>
<% for col = 0 to UBound(ReturnedRows,1)%>
<td style="font-family: Arial; font-size: 8pt">
<%=ReturnedRows(Col,Row)%>
</td>
<%next%>
</tr>
<%next%>


<%
Set objReportHeader = Nothing
RS.Close
Set RS = Nothing

Conn.Close
Set Conn = Nothing

%>
0
Comment
Question by:tcinwi
2 Comments
 
LVL 7

Accepted Solution

by:
John844 earned 100 total points
Comment Utility
<%for row = 0 to nRow

if row mod 30 = 0 then
  'add code here to write out header row
end if

%>
<tr>
<% for col = 0 to UBound(ReturnedRows,1)%>
<td style="font-family: Arial; font-size: 8pt">
<%=ReturnedRows(Col,Row)%>
</td>
<%next%>
</tr>
<%next%>
0
 
LVL 14

Expert Comment

by:puranik_p
Comment Utility

        No comment has been added lately, so it's time to clean up this TA.
        I will leave a recommendation in the Cleanup topic area that this question is:

->    Accept John844's comment as answer

         Please leave any comments here within the next seven days.
         
        PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
         
        puranik_p
         EE Cleanup Volunteer  

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now