Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating Display of Users plus sub-info

Status
Not open for further replies.

dcwave

IS-IT--Management
May 18, 2003
46
0
0
US
I am not if my title makes sense.

I have an asp report pulling from access. I need to display the information like this:

User Name 1
Item 1
Item 2
Item 3

User Name 2
Item 1
Item 2

User Name 3
Item 1


I am not sure how to structure my page and the query loop to display the info like this.

Thanks for you help.
 
As you loop through the reader, set a local variable equal to the user name. Display it. While the record's user name is equal to the stored variable name, display each item. When the name changes, reset the variable to the user name, display it, and continue.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Pity the amnesiac dyslexic agnostic. He stays up all night, wondering if there really is a dog.
 
Hey philhege - shouldn't it be insomniac dyslexic agnostic? Whatever.

dcwave - without knowing the information available from your database on users, it is hard to know how to format your report the way you wish.

First start with the table(s) structure. Identify the fields you want to display and how they are all related (if the fields come from multiple tables or from a single table).

Then decide how to pull out the data in username order, and how to get the remaining records. This might be done with a single SQL select, or a loop of 2 selects (the first gets the usernames, this sets up a loop and you use each username as a parameter to getting the user info.)

Once you have your data, then you need to decide how to format it. Probably something like this:
Code:
<p><%= username %>
<% loop info by current username %>
<br><%= info %>
<% end loop %>
Of course this is pseudo-code, not real ASP at this point. Just something to get you pointed in the right direction.

Good luck.

Einstein47
(For best results: hand wash in cold, tumble dry low. For not so good results: drag through puddles, pound on rocks, air dry on tree branch.)
 
Einstein47,

Exactly. I must have forgotten :)

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Pity the insomniac dyslexic agnostic. He stays up all night, wondering if there really is a dog.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top