Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to handle Child records from Child table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00835794
Message ID:
00836860
Vues:
9
Ah .. what you need is a multiple detail band report .. which isn't available in VFP. However, you can fake it with some tricks. First, you have to combine all the data into one cursor. Each record needs to have the parent info, a code field such as RECTYPE that determines which child table it came from ("1" for LarAppDwg and "2" for LarAppTsk.) The cursor will have to have all the fields from both child tables so there will be a lot of wasted space.

Once you have all this set, you can design the report with a data group on the parent field. Next, lay out all the fields for the first child table in the detail band. Set the Print When logic to RECTYPE = "1". Now you have to lay out all the fields of the 2nd child table in the detail band and change the Print When logic to RECTYPE = "2".

This gets real messy because all of the 2nd child's fields are laying on top of the 1st child's fields. To make this easier to design I usually start a dummy report and layout all the 2nd detail band info and get it set. Once it's all set, I copy and paste it to the first report.

I hope this helps,
Cathy


>Cathy,
>
>Thanks for your reply, but I probably need more information to nail down this report solution.
>
>I have Parent table DD_Lar (the one side of the one-too-many relationship).
>I have two Child tables DD_LarAppDwg, and DD_LarAppTsk. Both are many side of one-too-many relationship with Parent table.
>
>One Many
>------------- -------------------
>DD_LAR.lr_rcn ---------> DD_LARAppDwg.rd_rcn
> ---------> DD_LARAppTsk.rt_rcn
>
>In Report there is tabular (row/col) format with the DD_Lar data on top, and nested beneath this none, one, or both DD_LARAppDwg, and DD_LARAppTsk records in that order.
>
>LR_Number LR_Projid LR_Desc ........
>--------- --------- -------
>
>
>Drawings: RD_DwgNum RD_Desc .......
>
>
> ... ...
>
>Tasks: RT_TaskNum RT_Desc ........
>
>
> ... ...
>
>I tried several grouping schemes with the proper SET RELATION on _Rcn field between parent-->child tables, and couldn't get report to work right.
>
>
>Thanks,
>
>Fred Z
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform