Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OneToMany Relation
Message
From
28/10/1999 23:52:46
 
 
To
28/10/1999 06:08:02
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00282854
Message ID:
00283597
Views:
10
Thank you very much Cetin & Cindy for your help.

I have another question on the SQL query statement.
For instant I need to link the Parent.field (eg customer code)
to the Customer table to get Customer Name and a few more of
these type of links. How could I incoporate it into the SELECT
statement below? Thank you once again.

>Alvin,
>
>This is the best way to do reports: SELECT the data just as you would like it to appear in your report into a CURSOR. (Make sure the cursor is in the current work area.) Don't put the CURSOR or any other tables in the report's data environment. Refer to the field names in the report by field name only - no table name.
>
>
>cAlias = ALIAS()
>SELECT Parent.SomeField, Child.SomeOtherField ;
>    FROM Parent LEFT JOIN Child ;
>    ON Parent.Id = Child.Id ;
>    INTO CURSOR Temp
>
>REPORT FORM MyReport TO PRINTER NOCONSOLE
>SELECT (cAlias)
>
>
>Report fields SomeField and SomeOtherField (not Temp.SomeField, Temp.SomeOtherField)
>
>Then you can keep your grids working properly.
>
>
>>I have set the a Relation property of "OneToMany" to .T.
>>in order to print a Header & Detail report in the
>>Report's dataenviornment.
>>
>>After the report has printed and it goes back to the main
>>application, which has 2 grids that display Header and
>>Details, the Header Grid got hay-wire with a few lines
>>of record displaying ******* in the fields.
>>
>>But if I set the "OneToMany" Relation to .F., then there
>>isn't any problem. But the Report would only print one
>>line of the Detail record. Any suggestions? Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform