Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A little weekend puzzle
Message
De
16/11/1998 07:21:45
 
 
À
13/11/1998 17:02:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00157575
Message ID:
00157778
Vues:
16
>Ok - riddle me this,
>
>How can I get a report to print with a parent record and multiple-table child records? For example, suppose my parent table is "Person" - a person can have children and/or pets. How can I get the report to print something like this.
>
>
  JOHN DOE
>CHILDREN        PET
>----------      ---------------------------
>Bobby           Fluffy
>Tommy           Spot
>Sue
>Ann
>
>JIM SMITH
>CHILDREN        PET
>----------      ---------------------------
>Sam             Fido
>                Flipper
>                Lassie
>
>Of course any given person may have any number of pets or children or none or some of both or either (wow- that was mouthful). I'm playing with various joins to see if I can come up with something the report writer can deal with. Any ideas?

I assume you have two child tables (PETS, KIDS) so a join won't work. In similar cases I have done things like this:

1. Write a function GETSONS(PersonKey) which returns a string with all the sons of the person whose id is PersonKey, separated with CHR(13)'s.

2. Write a similar function GETPETS(PersonKey), which returns pets.

3. In the report, include both functions, and forget about SET RELATIONs, SET SKIPs, and so on.

HTH!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform