Solved

Count Recordset Rows in Array to Force Page Break in HTML

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using AJAX to call classic ASP function 4 94
An ASP query I cannot work out... 2 47
Time Conversions...both ways 2 15
ASP server side get value 15 21
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 …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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