I am trying to modify a report that needs to pull data from two tables. Are you able to have two tables associated to a report in FoxPro 2.6. When the user tries to run the report, FoxPro returns the error alias not found. Any suggestions, thanks.
another way to skin a cat is to try using a SQL select statement to drop the data you require from your existing two tables into either another table, or a cursor, and then choose your fields for your report from that new table or cursor.
an advantage of this is that you can immediately close your existing 2 tables after you execute your select statement, and before your report is run. this is especially beneficial if you expect users to preview a report, as your data tables are not open whilst they complete their preview.
Thanks for the advice but let me further explain my problem. I'm speaking of in the design of the report. It only shows one table (from the drop down list) and not two tables. I'm getting this error because the second table I need to use isn't on this drop down list. Is there a way to handle this in the design of the report or should I modify the code. Excerpt below. Thanks.
Here is an excerpt from the code in the .spr file...
Select entries
If m.rptdate = m.dsrdate
Select entries
Set order to tag Etime of ENTRIES.cdx
Locate for edate = m.rptdate
IF FOUND()
REPORT FORM dsrnew TO PRINT FOR edate = m.rptdate
ELSE
WAIT WINDOW " Date not on file " TIMEOUT 3
Close data
Select 0
Use table2
Select 0
Use entries
Select table2 (the table that is not currently available to you in the report designer)
Set order to tag xxx of table2 in table2 (where xxx is your key field)
Set relation to xxx into table2 additive
Modify report dsrnew
Then in the report designer choose
Report - Page Layout - Environment - Save
Then the fields in the second table will be available for you to select.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.