List all employees

Discussion in 'ASP General' started by JP SIngh, Oct 27, 2004.

  1. JP SIngh

    JP SIngh Guest

    Hi All

    I have a table which stores the employee details. The format of the table is
    below

    EmpNo _ Integer
    FirstName - Text
    Lastname - Text
    ManagerNo - Integer

    What I would like to do is to display in a tree structure all the employees
    reporting to a particular employee.

    For examples I might have 4 people reporting to me and also might have other
    employees reporting to those who report to me. Something like the structure
    below.

    Employee A
    Employee B
    Employee B.1
    Employee B.2
    Employee C
    Employee D
    Employee D.1
    Employee D.2
    Employee D.2.2
    Employee E

    Anyone has any idea who this can be done. Some sample code will be much
    appreciated
    thanks

    Jas
     
    JP SIngh, Oct 27, 2004
    #1
    1. Advertising

  2. If you are using SQL Server, look up "Expanding Hierarchies" in BOL. If some
    other database, post back and let us know which one.

    Bob Barrows
    JP SIngh wrote:
    > Hi All
    >
    > I have a table which stores the employee details. The format of the
    > table is below
    >
    > EmpNo _ Integer
    > FirstName - Text
    > Lastname - Text
    > ManagerNo - Integer
    >
    > What I would like to do is to display in a tree structure all the
    > employees reporting to a particular employee.
    >
    > For examples I might have 4 people reporting to me and also might
    > have other employees reporting to those who report to me. Something
    > like the structure below.
    >
    > Employee A
    > Employee B
    > Employee B.1
    > Employee B.2
    > Employee C
    > Employee D
    > Employee D.1
    > Employee D.2
    > Employee D.2.2
    > Employee E
    >
    > Anyone has any idea who this can be done. Some sample code will be
    > much appreciated
    > thanks
    >
    > Jas


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Oct 27, 2004
    #2
    1. Advertising

  3. JP SIngh

    JP SIngh Guest

    The database is Access 2000.

    thanks

    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > If you are using SQL Server, look up "Expanding Hierarchies" in BOL. If

    some
    > other database, post back and let us know which one.
    >
    > Bob Barrows
    > JP SIngh wrote:
    > > Hi All
    > >
    > > I have a table which stores the employee details. The format of the
    > > table is below
    > >
    > > EmpNo _ Integer
    > > FirstName - Text
    > > Lastname - Text
    > > ManagerNo - Integer
    > >
    > > What I would like to do is to display in a tree structure all the
    > > employees reporting to a particular employee.
    > >
    > > For examples I might have 4 people reporting to me and also might
    > > have other employees reporting to those who report to me. Something
    > > like the structure below.
    > >
    > > Employee A
    > > Employee B
    > > Employee B.1
    > > Employee B.2
    > > Employee C
    > > Employee D
    > > Employee D.1
    > > Employee D.2
    > > Employee D.2.2
    > > Employee E
    > >
    > > Anyone has any idea who this can be done. Some sample code will be
    > > much appreciated
    > > thanks
    > >
    > > Jas

    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    JP SIngh, Oct 27, 2004
    #3
  4. I don't have time to thoroughly deal with this question right now (I'm at
    work), so I suggest that you spend some time using Google to research using
    ASP to expand hierarchical data stored in an Access table using a
    self-referencing relationship into tree views. There, that should be enough
    keywords to keep you busy until tonight. Post back if you have specific
    questions and I will be able to address them then.

    Bob Barrows
    JP SIngh wrote:
    > The database is Access 2000.
    >
    > thanks
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:...
    >> If you are using SQL Server, look up "Expanding Hierarchies" in BOL.
    >> If some other database, post back and let us know which one.
    >>
    >> Bob Barrows
    >> JP SIngh wrote:
    >>> Hi All
    >>>
    >>> I have a table which stores the employee details. The format of the
    >>> table is below
    >>>
    >>> EmpNo _ Integer
    >>> FirstName - Text
    >>> Lastname - Text
    >>> ManagerNo - Integer
    >>>
    >>> What I would like to do is to display in a tree structure all the
    >>> employees reporting to a particular employee.
    >>>
    >>> For examples I might have 4 people reporting to me and also might
    >>> have other employees reporting to those who report to me. Something
    >>> like the structure below.
    >>>
    >>> Employee A
    >>> Employee B
    >>> Employee B.1
    >>> Employee B.2
    >>> Employee C
    >>> Employee D
    >>> Employee D.1
    >>> Employee D.2
    >>> Employee D.2.2
    >>> Employee E
    >>>
    >>> Anyone has any idea who this can be done. Some sample code will be
    >>> much appreciated
    >>> thanks
    >>>
    >>> Jas

    >>
    >> --
    >> Microsoft MVP -- ASP/ASP.NET
    >> Please reply to the newsgroup. The email account listed in my From
    >> header is my spam trap, so I don't check it very often. You will get
    >> a quicker response by posting to the newsgroup.


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Oct 27, 2004
    #4
  5. "JP SIngh" <> wrote in message
    news:...
    > Hi All
    >
    > I have a table which stores the employee details. The format of the table

    is
    > below
    >
    > EmpNo _ Integer
    > FirstName - Text
    > Lastname - Text
    > ManagerNo - Integer
    >
    > What I would like to do is to display in a tree structure all the

    employees
    > reporting to a particular employee.
    >
    > For examples I might have 4 people reporting to me and also might have

    other
    > employees reporting to those who report to me. Something like the

    structure
    > below.
    >
    > Employee A
    > Employee B
    > Employee B.1
    > Employee B.2
    > Employee C
    > Employee D
    > Employee D.1
    > Employee D.2
    > Employee D.2.2
    > Employee E
    >
    > Anyone has any idea who this can be done. Some sample code will be much
    > appreciated
    > thanks


    http://groups.google.com/groups?threadm=
     
    Chris Hohmann, Oct 27, 2004
    #5
  6. "Chris Hohmann" <> wrote in message
    news:ug2L%...
    > "JP SIngh" <> wrote in message
    > news:...
    > > Hi All
    > >
    > > I have a table which stores the employee details. The format of the

    table
    > is
    > > below
    > >
    > > EmpNo _ Integer
    > > FirstName - Text
    > > Lastname - Text
    > > ManagerNo - Integer
    > >
    > > What I would like to do is to display in a tree structure all the

    > employees
    > > reporting to a particular employee.
    > >
    > > For examples I might have 4 people reporting to me and also might have

    > other
    > > employees reporting to those who report to me. Something like the

    > structure
    > > below.
    > >
    > > Employee A
    > > Employee B
    > > Employee B.1
    > > Employee B.2
    > > Employee C
    > > Employee D
    > > Employee D.1
    > > Employee D.2
    > > Employee D.2.2
    > > Employee E
    > >
    > > Anyone has any idea who this can be done. Some sample code will be much
    > > appreciated
    > > thanks

    >
    >

    http://groups.google.com/groups?threadm=

    Sorry, forgot the part where you said you were using Access 2000. Here's a
    database agnostic version:
    http://groups.google.com/groups?selm=
     
    Chris Hohmann, Oct 27, 2004
    #6
  7. Try pulling all the data back & using a recursive function to display it
    within <ul>, kinda like

    rs = getdata()
    empid = request("employeeid")

    showgrunts rs, empid

    sub showgrunts(rs, id)
    var rsTmp
    set rsTmp = rs.clone
    response.write "<ul>"
    rsTmp.filter = "ManagerNo = " & id
    ' list employees
    while not rs.eof
    response.write "<li>" & rs("FirstName") & " " & rs("LastName")
    ' list this guys grunts
    showgrunts rs, rs("EmpNo")
    response.write "</li>"
    rs.movenext
    wend
    response.write "</ul>"
    set rsTmp = nothing
    end sub

    I'm assuming you dont have bajillions of employees.

    --
    Ben Strackany
    www.developmentnow.com


    "JP SIngh" <> wrote in message
    news:...
    > Hi All
    >
    > I have a table which stores the employee details. The format of the table

    is
    > below
    >
    > EmpNo _ Integer
    > FirstName - Text
    > Lastname - Text
    > ManagerNo - Integer
    >
    > What I would like to do is to display in a tree structure all the

    employees
    > reporting to a particular employee.
    >
    > For examples I might have 4 people reporting to me and also might have

    other
    > employees reporting to those who report to me. Something like the

    structure
    > below.
    >
    > Employee A
    > Employee B
    > Employee B.1
    > Employee B.2
    > Employee C
    > Employee D
    > Employee D.1
    > Employee D.2
    > Employee D.2.2
    > Employee E
    >
    > Anyone has any idea who this can be done. Some sample code will be much
    > appreciated
    > thanks
    >
    > Jas
    >
    >
     
    Ben Strackany, Oct 28, 2004
    #7
  8. JP SIngh

    JP SIngh Guest

    HI Chris

    Thanks for pointing this out. We are not fimiliar with XML hence looking for
    an ASP version of the code.


    "Chris Hohmann" <> wrote in message
    news:...
    > "Chris Hohmann" <> wrote in message
    > news:ug2L%...
    > > "JP SIngh" <> wrote in message
    > > news:...
    > > > Hi All
    > > >
    > > > I have a table which stores the employee details. The format of the

    > table
    > > is
    > > > below
    > > >
    > > > EmpNo _ Integer
    > > > FirstName - Text
    > > > Lastname - Text
    > > > ManagerNo - Integer
    > > >
    > > > What I would like to do is to display in a tree structure all the

    > > employees
    > > > reporting to a particular employee.
    > > >
    > > > For examples I might have 4 people reporting to me and also might have

    > > other
    > > > employees reporting to those who report to me. Something like the

    > > structure
    > > > below.
    > > >
    > > > Employee A
    > > > Employee B
    > > > Employee B.1
    > > > Employee B.2
    > > > Employee C
    > > > Employee D
    > > > Employee D.1
    > > > Employee D.2
    > > > Employee D.2.2
    > > > Employee E
    > > >
    > > > Anyone has any idea who this can be done. Some sample code will be

    much
    > > > appreciated
    > > > thanks

    > >
    > >

    >

    http://groups.google.com/groups?threadm=
    >
    > Sorry, forgot the part where you said you were using Access 2000. Here's a
    > database agnostic version:
    >

    http://groups.google.com/groups?selm=
    >
    >
     
    JP SIngh, Oct 28, 2004
    #8
    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. =?Utf-8?B?SklNLkgu?=

    Q: login for employees in internet

    =?Utf-8?B?SklNLkgu?=, Mar 10, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    342
    Scott Allen
    Mar 10, 2005
  2. John
    Replies:
    2
    Views:
    1,362
    llewelly
    Sep 4, 2003
  3. Shane Beasley
    Replies:
    2
    Views:
    383
    Govindan
    Sep 9, 2003
  4. kr0
    Replies:
    2
    Views:
    482
    Adam Maass
    Jun 12, 2006
  5. Steven Arnold
    Replies:
    0
    Views:
    291
    Steven Arnold
    May 19, 2005
Loading...

Share This Page