I am trying to print my records arranging it using basic HTML table
. I manage to arrange everything accordingly. I have also run a loop to insert some empty lines to fill the gap if the records are less. This will push the footer to the bottom of the page. The problem is when I click Print. It always gives me 2 sheets with sheet 2 being completely empty. I have tried to reduce the number of records and make sure it is only one page. But after hitting Print, it still shows 2 pages with page 2 being empty. Anyway to remove page 2, Please help
<html>
<body>
<center>
<%
call pageHeader()
dTotNet_Amt = 0
do while not rstERSLS1.eof
record = record + 1
dNet_Amt = rstERSLS1("NET_AMT")
dTotNet_Amt = dTotNet_Amt + dNet_Amt
response.write "<tr>"
response.write "<td align=left width=50><font face='Arial' size=2>" & record & "</td>"
response.write "<td align=left width=600 ><font face='Arial' size=2>" & rstERSLS1("PART") & "</td>"
response.write "<td align=left width=100 ><font face='Arial' size=2>" & rstERSLS1("SERIALNO") & "</td>"
response.write "<td align=right width=100 ><font face='Arial' size=2>" & pFormatDec(dNet_Amt,2) & "</td>"
response.write "</tr>"
rstERSLS1.movenext
'=== recordPerPage = 30
if record >= recordPerPage and not rstERSLS1.eof then
record = 0
sPage = sPage + 1
response.write"</table>"
response.write "<br/>"
response.write "<font face='Arial' size=1>"
response.Write"Continue Next Page..."
response.Write"<p style='page-break-before: always'></p>"
call pageHeader()
elseif rstERSLS1.eof then
'==== Fill the empty space and drag the footer to the bottom
do until record >= recordPerPage
record = record + 1
response.write "<td colspan=4 > </td>"
response.write "</tr>"
loop
end if
Loop
pCloseTables(rstERSLS1)
%>
'==== Footer
<table width="850">
<tr>
<td colspan=3 align=left width=700><font face="Arial" size=2>RINGGIT MALAYSIA : <%= ConvertCurrencyToEnglish(pFormatDec(dTotNet_Amt,2))%></td>
</tr>
<tr>
<td colspan="5">
<hr color=black style="margin-top:0px;margin-bottom:0px" size=1>
</td>
</tr>
</table>
<table width="850">
<tr>
<td colspan="3" align=left width=600><font face="Arial" size=2></font>E & OE</td>
<td align=left width=100><font face="Arial" size=2><b>Total (RM) : </b></font></td>
<td align=right width=100><font face="Arial" size=2><b>RM <%=pFormatDec(dTotNet_Amt,2)%></b></></font></td>
</tr>
<tr>
<td colspan="3" align=left width=600></td>
<td colspan="2">
<hr color=black style="margin-top:0px;margin-bottom:0px" size=2>
</td>
</tr>
<tr>
<td colspan="3"width=600></td>
<td colspan=2 align=left width=100><font face="Arial" size=1>Lorry Number : </font></td>
</tr>
<tr>
<td align=left width=250>______________________________</td>
<td align=left width=50></td>
<td align=left width=250>______________________________</td>
<td colspan=2 align=left width=100><font face="Arial" size=1>Driver Signature : </font></td>
</tr>
<tr>
<td align=left width=250><font face="Arial" size=2> AUTHORISED SIGNATURE(S)</font></td>
<td align=left width=50></td>
<td align=left width=250><font face="Arial" size=2> RECIPIENT'S CHOP & SIGNATURE</font></td>
<td colspan="2" align="left" width=100><font face="Arial" size=1>Store Keeper: </font></td>
</tr>
</table>
<p style='page-break-after: always'></p> '=== This doesn't work
</center>
</body>
</html>