469,353 Members | 2,163 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,353 developers. It's quick & easy.

How to split the contents of a page???


Hi,

Hi,

I have a problem in the display of the ASP screen actually i am
retrieving and displaying the data from a database when the view button is hit.The contents for display is so long so i want to have a previous, next link on that page so that some 100 records are displayed in each
page.Pls help me.
I am attaching my code here please help me where can i make the change
to split the display of my page.

This is for entering the couriers that is received in an company. Here
fd=from date fm=from month
td=to date
tm=to month
fy=from year
ty=to year
rpt=report
and this program displays the details of the courier received on the basis of the input fdate-from date and
tdate-todate will be displayed.
Please help me
<%@ LANGUAGE="VBSCRIPT" %>
<SCRIPT language="javascript">
function CClr(oCmp, Num)
{
if(Num == 1)
oCmp.style.backgroundColor = "#FFFFBF"
else
oCmp.style.backgroundColor = "#FFFFFF"
}

</SCRIPT>
<html>
<title>courier</title>
<body>

<%
dim fd,fm,fy
dim td,tm,ty
dim rpt,stxt
dim fdate, tdate
dim branch
dim toatalrec
fd=Request.QueryString("fd")
fm=Request.QueryString("fm")
fy=Request.QueryString("fy")
branch=Request.QueryString("branch")
fdate=fm+"/"+fd+"/"+fy

td=Request.QueryString("td")
tm=Request.QueryString("tm")
ty=Request.QueryString("ty")
tdate=tm+"/"+td+"/"+ty

stxt =Request.QueryString("stxt")
number=Request.QueryString("number")

rpt="N"
dim cn, rs
set cn = Server.Createobject("ADODB.Connection")
set rs = Server.Createobject("ADODB.Recordset")

//cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=mmpl;Data Source=mailserver", "it","it"

cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=mmpl;Data Source=aarServer",
"it","it"

if stxt=VbnullString then
if branch="ALL" then
rs.Open "select * from mmpl_in_trans where rpt_date>='" & fdate & "'
and rpt_date<='" & tdate &"'", cn

else

rs.Open "select * from mmpl_in_trans where rpt_date>='" & fdate & "'
and rpt_date<='" & tdate &"' and in_fn='" & branch &"'", cn

end if

response.write("<font Face='Arial Unicode MS'><B>INWARD ENTRY <a
href='eml_in.asp'>back</a> <a href='..\mmplinout.asp'>Home
page</a></br>")
Response.Write ("<Font Face='Arial Unicode MS'><B>From : " & fdate & "
to : " & tdate &" </br>")

rpt="Y"

else

rs.Open "select * from mmpl_in_trans where in_details like '%" & stxt & "%' order by in_fn", cn

response.write("<font Face='Arial Unicode MS'><B>INWARD entry</b> <a
href='eml_in.asp'>back</a> <a href='..\mmplinout.asp'>Home
page</a></br>")

Response.Write ("<Font Face='Arial Unicode MS'><B>Searched for : " &
stxt &"</br>")

rpt="Y"

end if

if rpt="Y" then
response.write("<table border=0 > ")

response.write("<tr colspan=0 onblur='CClr(this, 2)'
onfocus='CClr(this, 1)'><th bgcolor=orange><Font Face='Arial Unicode MS' size=2>DOCDT </Font></th>")

response.write("<th height=5 bgcolor=orange><Font Face='Arial Unicode
MS' size=2> BRANCH </Font></th>")

response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
size=2>DEPT </Font></th>")

response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
size=2>DETAILS </Font></th>")

response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
size=2>COU NO </Font></th>")

response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
size=2>COU DATE </Font></th>")

response.write("<th bgcolor=orange nowrap ><Font Face='Arial Unicode
MS' size=2> REC TIME </Font></th>")

response.write("</tr><tr>")

if Rs.EOF=False then
Rs.MoveFirst()

With Rs
response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >" & .Fields("IN_DATE") &"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"+.Fields("IN_FN")+"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"+.Fields("IN_DP")+"</Font></td>")

response.write("<td bgcolor='#A4D867'><Font face='Arial Unicode MS'
size=2 >"+.Fields("IN_DETAILS")+"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"+.Fields("IN_CRNO")+"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"&.Fields("IN_CRDATE")&"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"+.Fields("ENT_TIME")+"</Font></td>")

response.write("<tr>")
Rs.MoveNext()

End with
next
End if
End if

%>
</table>
<input type="Submit" name="submitted" value="Next">
</Font></pre></font><form>
</BODY>
</HEAD>
</HTML>

Thanks,

Aarthy


*** Sent via Developersdex http://www.developersdex.com ***
Oct 17 '05 #1
2 1853
http://aspfaq.com/show.asp?id=2120

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"aarthy" <bu****@devdex.com> wrote in message
news:O$**************@TK2MSFTNGP14.phx.gbl...

Hi,

Hi,

I have a problem in the display of the ASP screen actually i am
retrieving and displaying the data from a database when the view

button
is hit.The contents for display is so long so i want to have a

previous,
next link on that page so that some 100 records are displayed in each
page.Pls help me.


I am attaching my code here please help me where can i make the change
to split the display of my page.

This is for entering the couriers that is received in an company. Here
fd=from date

fm=from month
td=to date
tm=to month
fy=from year
ty=to year
rpt=report
and this program displays the details of the courier
received on the basis of the input

fdate-from date and
tdate-todate will be displayed.
Please help me


<%@ LANGUAGE="VBSCRIPT" %>
<SCRIPT language="javascript">
function CClr(oCmp, Num)
{
if(Num == 1)
oCmp.style.backgroundColor = "#FFFFBF"
else
oCmp.style.backgroundColor = "#FFFFFF"
}

</SCRIPT>
<html>
<title>courier</title>
<body>

<%
dim fd,fm,fy
dim td,tm,ty
dim rpt,stxt
dim fdate, tdate
dim branch
dim toatalrec
fd=Request.QueryString("fd")
fm=Request.QueryString("fm")
fy=Request.QueryString("fy")
branch=Request.QueryString("branch")
fdate=fm+"/"+fd+"/"+fy

td=Request.QueryString("td")
tm=Request.QueryString("tm")
ty=Request.QueryString("ty")
tdate=tm+"/"+td+"/"+ty

stxt =Request.QueryString("stxt")
number=Request.QueryString("number")

rpt="N"
dim cn, rs
set cn = Server.Createobject("ADODB.Connection")
set rs = Server.Createobject("ADODB.Recordset")

//cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist

Security
Info=False;Initial Catalog=mmpl;Data Source=mailserver", "it","it"

cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist
Security Info=False;Initial Catalog=mmpl;Data Source=aarServer",
"it","it"

if stxt=VbnullString then
if branch="ALL" then
rs.Open "select * from mmpl_in_trans where rpt_date>='" & fdate & "'
and rpt_date<='" & tdate &"'", cn

else

rs.Open "select * from mmpl_in_trans where rpt_date>='" & fdate & "'
and rpt_date<='" & tdate &"' and in_fn='" & branch &"'", cn

end if

response.write("<font Face='Arial Unicode MS'><B>INWARD ENTRY <a
href='eml_in.asp'>back</a> <a href='..\mmplinout.asp'>Home
page</a></br>")
Response.Write ("<Font Face='Arial Unicode MS'><B>From : " & fdate & "
to : " & tdate &" </br>")

rpt="Y"

else

rs.Open "select * from mmpl_in_trans where in_details like '%" & stxt

&
"%' order by in_fn", cn

response.write("<font Face='Arial Unicode MS'><B>INWARD entry</b> <a
href='eml_in.asp'>back</a> <a href='..\mmplinout.asp'>Home
page</a></br>")

Response.Write ("<Font Face='Arial Unicode MS'><B>Searched for : " &
stxt &"</br>")

rpt="Y"

end if

if rpt="Y" then
response.write("<table border=0 > ")

response.write("<tr colspan=0 onblur='CClr(this, 2)'
onfocus='CClr(this, 1)'><th bgcolor=orange><Font Face='Arial Unicode

MS'
size=2>DOCDT </Font></th>")

response.write("<th height=5 bgcolor=orange><Font Face='Arial Unicode
MS' size=2> BRANCH </Font></th>")

response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
size=2>DEPT </Font></th>")

response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
size=2>DETAILS </Font></th>")

response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
size=2>COU NO </Font></th>")

response.write("<th bgcolor=orange><Font Face='Arial Unicode MS'
size=2>COU DATE </Font></th>")

response.write("<th bgcolor=orange nowrap ><Font Face='Arial Unicode
MS' size=2> REC TIME </Font></th>")

response.write("</tr><tr>")

if Rs.EOF=False then
Rs.MoveFirst()

With Rs
response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >" & .Fields("IN_DATE") &"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"+.Fields("IN_FN")+"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"+.Fields("IN_DP")+"</Font></td>")

response.write("<td bgcolor='#A4D867'><Font face='Arial Unicode MS'
size=2 >"+.Fields("IN_DETAILS")+"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"+.Fields("IN_CRNO")+"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"&.Fields("IN_CRDATE")&"</Font></td>")

response.write("<td align=Center bgcolor='#A4D867'><Font face='Arial
Unicode MS' size=2 >"+.Fields("ENT_TIME")+"</Font></td>")

response.write("<tr>")
Rs.MoveNext()

End with
next
End if
End if

%>
</table>
<input type="Submit" name="submitted" value="Next">
</Font></pre></font><form>
</BODY>
</HEAD>
</HTML>

Thanks,

Aarthy


*** Sent via Developersdex http://www.developersdex.com ***

Oct 17 '05 #2
"The contents for display is so long so i want to have a
previous, next link on that page so that some 100 records are displayed
in each page."

Some good paging links:

Database Paging
http://www.asp101.com/samples/db_paging.asp
Uses PageSize method of recordset.

Paging Records with GetRows by Mukul Sabharwal - 7/5/2000
http://www.4guysfromrolla.com/webtech/070500-1.shtml
Uses GetRows.

Displaying a certain # of records on each webpage Paging
http://www.aspfree.com/asp/startpage.asp?id=11
Uses PageSize method of recordset.
Shorter.

Recordset Paging with ADO 2.0 by Michael Qualls
http://www.asp101.com/articles/recor...ging/index.asp
Uses PageSize method of recordset.
Longer with more comments.

Paging Demo provides Count and Navigation at the top of the Page!
http://www.aspfree.com/asp/startpage.asp?id=65

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips

*** Sent via Developersdex http://www.developersdex.com ***
Oct 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Tom Szabo | last post: by
2 posts views Thread by middletree | last post: by
5 posts views Thread by wardellcastles | last post: by
15 posts views Thread by JWest46088 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.