How to split the contents of a page???

Discussion in 'ASP General' started by aarthy, Oct 17, 2005.

  1. aarthy

    aarthy Guest

    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 ***
     
    aarthy, Oct 17, 2005
    #1
    1. Advertising

  2. aarthy

    Steven Burn Guest

    http://aspfaq.com/show.asp?id=2120

    --
    Regards

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

    Keeping it FREE!

    "aarthy" <> wrote in message
    news:O$...
    >
    > 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 ***
     
    Steven Burn, Oct 17, 2005
    #2
    1. Advertising

  3. aarthy

    Bullschmidt Guest

    "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/recordsetpaging/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 ***
     
    Bullschmidt, Oct 17, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aarthy kumar
    Replies:
    3
    Views:
    401
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 12, 2005
  2. aarthy
    Replies:
    1
    Views:
    390
    Juan T. Llibre
    Oct 12, 2005
  3. Replies:
    2
    Views:
    475
  4. Carlos Ribeiro
    Replies:
    11
    Views:
    712
    Alex Martelli
    Sep 17, 2004
  5. trans.  (T. Onoma)

    split on '' (and another for split -1)

    trans. (T. Onoma), Dec 27, 2004, in forum: Ruby
    Replies:
    10
    Views:
    226
    Florian Gross
    Dec 28, 2004
Loading...

Share This Page