Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Grouping with multi-level relational databases
Message
From
03/05/2004 21:58:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00900465
Message ID:
00900578
Views:
18
>I am having trouble getting VFP (6) to recognize multiple table entries in related tables outside the currently selected table. In other words, if tableA has 1 or more records and is related to tableB (multiple records for every tableA record) which is related to Table C (multiple records for every tableB record) - the report generator only recognizes 1 table's record count.
>
>If I select tableA and call .FRX, I get only the 1 record per table printed.
>
>Does this make sense? It is really hard to explain without visual aids.
>
>Any assistance is greatly appreciated.

The way I do this - without exception, in all cases I worked on in recent years - is to create a single cursor that combines the data from several tables.

For example, say you need data from invoices. The invoices has a client code; you want to fetch the client name, from the client table. Your SQL statement might look something like this:
select invoice.inv_date, invoice.total, client.fullname;
  from invoice join client on invoice.clientid = client.clientid;
  into cursor TempReport
report form ...
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform