?
Solved

Count Recordset Rows in Array to Force Page Break in HTML

Posted on 2001-06-22
2
Medium Priority
?
371 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
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/…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 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