Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Add dividing line between grouped records...

Reply
Thread Tools

Add dividing line between grouped records...

 
 
david@scene-double.co.uk
Guest
Posts: n/a
 
      01-19-2005
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

 
Reply With Quote
 
 
 
 
Murray Jack
Guest
Posts: n/a
 
      01-19-2005
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: oups.com...
> 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
>



 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      01-19-2005
<> wrote in message
news: oups.com...
> 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
%>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grouped grid? Or grid within datalist? Danny Tuppeny ASP .Net 1 10-27-2005 10:03 PM
Datagrid with grouped data mj ASP .Net 1 07-17-2005 10:06 AM
Can hidden controls be grouped and posted together? Ken Adams HTML 1 03-19-2005 09:44 PM
head for grouped data - looking for best practice Harald Massa Python 4 03-12-2005 09:31 PM
Creating new subtotal nodes grouped by 2 values J. T. XML 0 08-11-2004 04:05 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57