Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two different tables on one report
Message
From
09/12/1997 14:56:40
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00064748
Message ID:
00064751
Views:
30
>I want to create a report with two different and unrelated tables.
>The first table wiil show a max of five records The second will show a max of about 50 records.
>
>I have created two seperate reports one for each table and each is fine.
>
>I want to be able to be able to run the shorter one then have the longer one print right after that continuing on the same page. Both tables have only one matching field and that field contains the same valve for all records.
>
>Can this be done.
>
>If not in foxpro. will cystal Reports do it.
>
>Any help would be greatly appreciated.
>
>Thanks Keith Hartman

Yes it can bedone in Foxpro. Basically, you have to 'concatenate' two tables in one cursor doing following:
1. CREATE CURSOR tmpReport with nuber of fileds=fcount("table1")+fcount("table2")+1, i.e. it will have enough space for any field plus one more field-report group identifier (e.g. 'listorder').
2. You SCAN first table and INSERT into tmpReport (listorder,field1,field2..) VALUES(1,table1.field1,table1.field2)
3. You do the same with the second table, but now you INSERT into tmpReport (listorder,field7,field8..) VALUES(2,table1.field1,table1.field2), i.e. other fields and another identifier.
4. Now you create report form grouping by listorder and having as many report fields as necessary. Each field will use "Print When" setting evaluating Listorder value.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform