Help with Groups and Sub-groups

Startbeitrag von Raymond Thomas am 31.07.2009 09:10

I need some help and guidance on how to implement the following in WinDev: I want to store and retrieve data of people that belong to various groups and sub-groups.

I can easily do Parent Group and Sub-Group for one level but need to have unlimited levels ie. sub groups of sub groups. How would I structure my tables if multiple sub-groups are needed. I then also need to run a report by group or sub-group which must display all the people belonging to the all the lower levels.

Example:

Group A
-- Sub-group A1
---- Sub-group A11
------ Sub-group A111
------ Sub-group A12
---- Sub-group A2
------ Sub-group A21
------ Sub-group A22
Group B
-- Sub-group B1

Any help would be appreicated.

Thanks

Antworten:

Hi Raymond...

an 'easy' way to do that is to use ONE file in which you have:
- name of the current group
- 'level' of the group (0 for the master level, 1 for Sub level 1, and
so on)
- ID of the parent level...

You can then browse on the level 0 to display your initial master
groups, and when clicking on a master, find all the sublelves if it
using the parent ID key

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


Raymond Thomas wrote:
> I need some help and guidance on how to implement the following in WinDev: I want to store and retrieve data of people that belong to various groups and sub-groups.
> I can easily do Parent Group and Sub-Group for one level but need to have unlimited levels ie. sub groups of sub groups. How would I structure my tables if multiple sub-groups are needed. I then also need to run a report by group or sub-group which must display all the people belonging to the all the lower levels.
> Example:
> Group A
> -- Sub-group A1
> ---- Sub-group A11
> ------ Sub-group A111
> ------ Sub-group A12
> ---- Sub-group A2
> ------ Sub-group A21
> ------ Sub-group A22
> Group B
> -- Sub-group B1
>
> Any help would be appreicated.
> Thanks
>
>
Message forwarded from pcsoft.us.windev

von Fabrice Harari.pcs.crosspost - am 31.07.2009 12:05
Thanks Fabrice, I will give it a try.

von Raymond Thomas - am 31.07.2009 16:53
It's been a while since my original question about Groups and Sub-groups but I am now struggling with the reporting side of this. I managed to create the table structure to store the members in the various groups and subgroups but now need help with the reporting aspects.

My table structure for the groups is as follows:

GroupID
GroupName
ParentID

ie.

example group data:








GroupID 

GroupName 

ParentID




1

Grade A   

0




2

Music

1




3

Keyboards

2




4

Beginner

3




5

Intermediate

3




6

Advanced

3





example of members groups table








MemberName 

GroupID




John 

4




Mary 

5




Kate

6






Now I want to write a report that will print the members for a certain group ie. if the Music group is selected then all the members in the Music group and it's subgroups must be printed or if the Advanced group is selected then only members in that group is printed.

Any help would be appreciated.




von Raymond Thomas - am 08.02.2010 14:07
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.