Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
It's in the details...not : )
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00402564
Message ID:
00403784
Views:
11
Barbara,
You're right about the overlapping fields, what a mess, but the results
are just what I was looking for. Thanks again for your help.

John.

>John,
>You're right on track. Make sure you cursor is ordered by the codes, so all of the Child1 records are together, all of the Child2 together, etc. The hardest part remaining is getting all of the fields on the report to 'print when' correctly. In VFP3 (my first try at this kind of report) I ended up with all the fields overlapping each other. A NIGHTMARE to update, but the client loved the result.
>
>Barbara
>
>>Hi Barbara,
>>
>>Let me see if I have this correct. Create an updatable cursor with all of the
>>required fields for the parent and the three child tables, plus a field that will hold a code for determining which child table the record came from. Next,
>>do my selects (one for each child table?) and insert the results into the cursor (and include the correct child code per select).
>>
>>I will always have only one parent record as the report will only be reporting on one address (parcel), so the details band will then report on all of the child information for this parcel based on the childcode field (which is how I will sort data) so if I have three child tables and they each have two records that match the parent, I will end up with 6 records in the report_cursor two with childcode = "A" two with childcode = "I" two with childcode = "T"
>>How am I doing so far -- Am I way off here or getting warmer? : )
>>
>>Thanks.
>>
>>John.
>>
>>
>>
>>
>>>John,
>>>The simplest way I've found is to get a report cursor with a row for each entry. You can try to set up a single gigantic SELECT statement, or simply add to the cursor. Basically you have a field (or fields as required) for each child table PLUS a field that stores a code for each ("A"rchive, "T"racking, etc.).
>>>Parent ID  ChildCode   Child1       Child2     Child3
>>>1          A           Yes
>>>1          A           Probably
>>>1          T                        08/8/00
>>>2          I                                    $27.00
>>>2          A           Yes
>>>2          T                        07/31/00
>>>Then in your report you order the cursor by ChildCode within each Parent grouping, and print the data using the Print When field to blank out fields not used for a specific ChildCode.
>>>
>>>Hope this is clear. If not, let me know.
>>>
>>>Barbara
>>>
>>>>Hi all,
>>>>
>>>>Unfortunately I don't get to work with VFP as much as I used to and
>>>>I've been busting my brain for a couple of hours now trying to figure out how in the world to get this one-to-many report to work.
>>>>
>>>>I have a parent table with three (many) children tables(tracking,archive,inspectorlead). These child tables are holding tracking and archived information and are related to the parent by a parcel code field. What I need is a report that shows the parent information and all of the entries from each of these tables. There could be from 0 to possibly 10 detailed records in anyone of these three children tables. I can get this to work with only one of the three tables (querying into one cursor), but add the other two and things go horribly wrong. I would like to use a cursor or a view as my data source so that relations are not needed other than to query the data.
>>>>
>>>>I would appreciate any ideas from the experts!
>>>>
>>>>Thanks.
>>>>
>>>>john.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform