Add dividing line between grouped records...

Discussion in 'ASP General' started by david@scene-double.co.uk, Jan 19, 2005.

  1. Guest

    Hi,

    I have a simple asp page which throws out a list of products on order
    by Customer X.

    As the page writes out the lines, I want to add a Horizontal Rule when
    the ProductName changes .... i.e.

    Product A
    Product A
    Product A
    _________________

    Product B
    Product B

    _________________

    Product C
    Product C
    Product C

    And so on.

    I can only get the code to write a line after each individual record.
    Appreciate your help on this


    Thanks in advance


    David
     
    , Jan 19, 2005
    #1
    1. Advertising

  2. Murray Jack Guest

    you will need to setup a test to see if the group has changed and then print
    the line

    Giving something like this

    <%
    Dim strProductName as string

    Do until rstProducts.eof
    if strProductName <> rstProducts("ProductName") Then
    Response.write "<hr>"
    end if

    response.write rstProducts("ProductName")
    strProductName = rstProducts("ProductName")

    rstProducts.movenext
    Loop
    %>




    <> wrote in message
    news:...
    > Hi,
    >
    > I have a simple asp page which throws out a list of products on order
    > by Customer X.
    >
    > As the page writes out the lines, I want to add a Horizontal Rule when
    > the ProductName changes .... i.e.
    >
    > Product A
    > Product A
    > Product A
    > _________________
    >
    > Product B
    > Product B
    >
    > _________________
    >
    > Product C
    > Product C
    > Product C
    >
    > And so on.
    >
    > I can only get the code to write a line after each individual record.
    > Appreciate your help on this
    >
    >
    > Thanks in advance
    >
    >
    > David
    >
     
    Murray Jack, Jan 19, 2005
    #2
    1. Advertising

  3. McKirahan Guest

    <> wrote in message
    news:...
    > Hi,
    >
    > I have a simple asp page which throws out a list of products on order
    > by Customer X.
    >
    > As the page writes out the lines, I want to add a Horizontal Rule when
    > the ProductName changes .... i.e.
    >
    > Product A
    > Product A
    > Product A
    > _________________
    >
    > Product B
    > Product B
    >
    > _________________
    >
    > Product C
    > Product C
    > Product C
    >
    > And so on.
    >
    > I can only get the code to write a line after each individual record.
    > Appreciate your help on this
    >
    > Thanks in advance
    >
    > David


    Will this help?

    Dim strPRD
    strPRD = ""

    <% If strPRD <> Product Then
    If strORD <> "" Then
    %>
    <hr>
    <% End If
    strPRD = Product
    End If
    %>
     
    McKirahan, Jan 19, 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. mj

    Datagrid with grouped data

    mj, Jul 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    487
    Eliyahu Goldin
    Jul 17, 2005
  2. Danny Tuppeny

    Grouped grid? Or grid within datalist?

    Danny Tuppeny, Oct 27, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    523
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Oct 27, 2005
  3. Ken Adams
    Replies:
    1
    Views:
    374
    Jukka K. Korpela
    Mar 19, 2005
  4. J. T.
    Replies:
    0
    Views:
    379
    J. T.
    Aug 11, 2004
  5. Harald Massa
    Replies:
    4
    Views:
    351
    Harald Massa
    Mar 12, 2005
Loading...

Share This Page