Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One-To-Many Reports Usings Views for FP26 Tables
Message
 
To
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:
00407139
Views:
29
Cindy,

"Never make reports from related tables"? How do I design a report that is based on a one to many relationship? Do I create a view establishing that relationship between the parent and child tables, then place that view in the data environment of the report?

I already have the parent and child views established in the form that will be calling this report. The form also establishes the relationship between the parent and the child views.

Are you telling me to not use the data environment of the report designer? I have to design this report to a specific format.

I think I can extract the data using a SELECT statement as you described below, but how do I use my report format and where does that SELECT statement go?

Thanks
Elgin

>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
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform