Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Count Recordset Rows in Array to Force Page Break in HTML

Posted on 2001-06-22
2
Medium Priority
?
385 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 400 total points
ID: 6219921
<%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
ID: 9019059

        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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

810 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