Solved

Count Recordset Rows in Array to Force Page Break in HTML

Posted on 2001-06-22
2
360 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML in email body has extra  tick marks 3 88
Time/Date Query 11 43
JSON error 4 71
ASP/VB email question 4 46
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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/…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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