Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple detail lines
Message
From
11/05/2001 07:20:13
 
 
To
11/05/2001 00:00:33
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00506110
Message ID:
00506142
Views:
26
Hi!

Just prepare cursor for your report properly:

SELECT PARENT.*, CHILD.* from PARENT LEFT JOIN CHILD ON PARENT.ID=CHILD>Parent_ID WHERE ... ORDER BY PARENT.NAME INTO CURSOR ...

Note that ordering is important here because the order field will be used for grouping in report.

Than select that cursor as a current and run report. Report takes it values from the current alis if nothing opened in the report data environment.

To display parent/child info in the rpeort, use grouping. For above SELECT statement grouping expression will be by NAME field used for sorting (It might be more complex in your case). Than in details display information from child fields. Information from parent fields could be displayed in the group title and/or footer. If child records do ne exist for some parent record, you will get all .NULL. values in the child fields. In the report there is the "Print When..." option for controls, where you can put a logical expression to do not print control in some cases - like .NULL. values for example. Check also checkbox to do not print details line of information is empty. This way you will get only parent record without children.

HTH.

>Hi all,
>
>I'm sure this topic has been discussed before, so forgive me. But is there a simple way to get VFP 6.0 to print
>detail lines from multiple child tables? I want to print detail lines from two different tables in two different areas on
>my report, but I do not know how to do this.
>
>Microsoft Knowledge base has a solution published (Q119354), but it seems that there ought to be a simpler
>solution for what must be a common need. Someone please tell me that I'm overlooking something.
>
>Thanks in advance.
>
>Fred E. Beaulieu
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform