The information in this article applies to:
- Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 5.0a
- Visual FoxPro for Macintosh, version 3.0b
SYMPTOMS
A report for three tables, where the tables have a parent, child, and
grandchild one-to-many relation, does not display all the related records
in the grandchild table for each of the records in the child table. Only
the first related grandchild record prints.
RESOLUTION
To list all the related records in the grandchild table for each of the
records in the child table:
- Use the SET SKIP command. Place it in the Init event of the report's
data environment to set the one-to-many relation from child and
grandchild into the parent.
-or-
- Set the IntitialSelectedAlias property of the report's data environment
to the child table.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
- Open the Testdata Database that should be in the \Samples\Data directory
under the Main Visual FoxPro directory.
- Create a new report, and call it Test.
- Open the data environment of the report and add the Customer, Orders,
and OrdItems tables to it. Make sure the relation is set among these
tables so that the Orders table is a child of the Customer table, and
the OrdItems table is a child of the Orders table. The OrdItems table is
the grandchild of Customer table.
- Set the OneToMany property of both the relations in the report data
environment to true (.T.-True).
- Set the Order property of the Customer table to Cust_Id and the Order
property of the Orders table to Order_Id.
- Set the InitialSelectedAlias property of the report data environment
to the Customer table.
- Create a report group for Customer.Cust_Id and another report group for
Orders.Order_Id.
- Place the Cust_Id and Company fields of the Customer table in the first
group header (Customer.Cust_Id).
- Place the Order_Id and Order_Amt fields of the Orders table in the
second group header (Orders.Order_Id).
- Place the Line_No,Product_ID, and Unit_Price fields of the OrdItems
table in the Detail band.
- Add whatever titles you think are necessary to each of the Bands.
- Preview the Report. Only one OrdItems record related to each of the
Orders record appears.
Example Resolution
To fix this behavior:
Keywords : FxtoolRwriter VFoxMac vfoxwin
Version : Win:3.0,3.0a,5.0,5.0a; Mac:3.0
Issue type : kbprb
|