Add dividing line between grouped records...

D

david

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
 
M

Murray Jack

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
%>
 
M

McKirahan

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
%>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top