Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One-To-Many Reports Usings Views for FP26 Tables
Message
From
19/08/2000 22:08:21
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00407117
Message ID:
00407127
Views:
30
Elgin,

You can create a calculated field in a view using the "Functions and expressions" box in the lower left of the first tab of the view dialog box. Then you can establish your relationship.

That being said, I never make reports from related tables. There's just too much room for bugs. Usually reports are called from forms, and all you need to do is put some code under the "go" button like:
SELECT .... ;
    FROM Table1 JOIN Table2 ;
    ON Table1.Field1 = Table2.Field1 ;
    AND Table1.Field2 = Table2.Field2 ......
Also, there is no need to construct views for this purpose. (You may already have views for some other reason.) Just write the SQL you need. You may be able to copy some of the SQL that the view desiger generates.

You will eventually run into some more complicated constructs that the view designer can't handle, so it's always wise to learn to write your own SQL.



>I am trying to design a couple of one-to-many reports. The data environment for the first report will be made up of views that select records from FPD26 tables. The parent view is "nameplatv" and the child view is "dgav". These views are in my database container to select records from the FPD26 tables "nameplat" and "dga" respectively.
>
>How do I establish the one-to-many relationship between the two views based on "custid+upsino", which are fields in each view? Do I have to do this programmatically? And which method of the dataenvironment do I place the code in?
>
>The second report I will design will use the same parent view but multiple child views. Will I do the same thing there?
>
>Thanks
>
>Elgin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform