This topic is locked

Possible to hide repeated field data?

1/26/2006 21:05:03
ASPRunnerPro General questions
Pete M author

Hi,
I would like to remove duplicate entries in one of my fields, ie
CUSTOMER............ORDER

Customer No 1......Order No 1

Customer No 1......Order No 2

Customer No 1......Order No 3

Customer No 2......Order No 4

Customer No 2......Order No 5

Customer No 2......Order No 6
--->
CUSTOMER.............ORDER

Customer No 1......Order No 1

............................Order No 2

............................Order No 3

Customer No 2......Order No 4

............................Order No 5

............................Order No 6
Is this possible?
Thanks,
Pete

Sergey Kornilov admin 1/27/2006

You can do this modifing Sub LoopRs in ..._list.asp file.

See my changes in bold.

  1. Declare a new variable which will hold current customer number
    Customer=""

    DO UNTIL rs.eof OR iNumberOfRows>=nPageSize


2. Display customer number only when it's changed.

if IsBinaryField(rs.Fields("Customer")) or Format("Customer")=FORMAT_DATABASE_FILE then

Response.Write CreateImageControl(rs, "Customer", "")

else

strData = GetData(rs.Fields("Customer"), "")
if Customer<>strData then

Response.Write "<b>" & ProcessLargeText(strData,"picfield=" & Server.URLEncode("Customer") & "&where=" & Server.URLEncode(strImageWhere),"") & "</b>"

Customer=strData

end if

end if

Pete M author 1/27/2006

Thanks Sergey - that worked great. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7775&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' />
Pete