Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to have 2 tables/cursors in a FoxPro report?

Status
Not open for further replies.

Kerpal

Programmer
May 5, 2003
4
US
Greeting FoxPro Comrades,
I ran into a situation that I would like to use two or more cursors/tables in a FoxPro report but I dont know if this could be done. Right now I have to use UNION SQL combine the cursors together and then generate report.
Thanks you kindly for looking at this.

 
Kerpal,

You can have more than one table / cursor in the report, but only one of them can actually drive the report. As the report is printed, it will skip through the records of the "main" table, printing an instance of the detail band for each record it finds.

Other tables can still be used. For example, you could include a lookup table which provides descriptive text in place of numeric codes. Your report might then use the LOOKUP() function to obtain the data from that table.

But if you want two or more tables to actually drive the report, you will have to find some way of combining them into a single cursor or table. A union is one way to do that, but my no means the only one.

Hope this helps.

Mike


Mike Lewis
Edinburgh, Scotland
 
You can have as many tables in the report as you want - just qualify the field names: table1.fielda, table2.fieldb, etc. You just need to have the appropriate relationships set.

Jim
 
Kerpal (Programmer)
Why not?
I have my report based on two tables. One of my oldest programs had 20 tables and many, many, many relations between them. It took me 1 month to create that jungle of relations but it worked and still does.
Regards

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
Mike,Jim and ShyFox.
Thanks muchly for your insight, you guys are the best!!
Regards,

Thao
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top