Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to print from more than one table.
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00097344
Message ID:
00097524
Views:
18
>>Sounds like you need to set a relation between your Course Table and Evaulation Table based on Student Number and with Courses as parent table. Then you can create a report using fields from both tables. That would be a simple approach, if your report requires multiple groups and complex index keys, you might want to consider SQL Select'ing your data into a temp cursor or view to drive the report instead of relating the source tables with SET RELATION. HTH
>
>Actually, and this is my fault for not making this clear before, there is no relationship between Course and Evaluation. The relationships are a one-to-many between Students and Course and a one-to-many between Students and Evaluation. The evaluations are general knowledge type evaluations and are not based on any one specific course. Your SQL suggestion gave me the idea of doing 2 SQL's UNIONed together into one cursor. Is this what you were thinking or is there maybe a better way? Thanx

Well I thought you had a relationship between the two tables since you said Student Number was common to both, and that perhaps you could do a regular SQL join on that field. But if that's not the case, a UNION would work and I am forced to use that approach in many of my reports. The idea here is to create a temporary cursor that is structured in such a way as to drive the report. For example, maybe a table structure on the cursor like this:

StudentNum
CourseID (only Containing data for records from Course Table)
CourseInfo (only Containing data for records from Course Table)
EvalID (only Containing data for records from Evaluations Table)
EvalGrade (only Containing data for records from Evaluations Table)

Then when you setup your report, in the detail band you will want to have CourseID and CourseInfo with a PRINT WHEN Condition of NOT EMPTY(CourseID). And over top of those two fields, put EvalID and EvalGrade with PRINT WHEN condition of NOT EMPTY(EvalID). As you can see the the cursor wont be pretty relational data, and the detail band in report wont be pretty either, but it will make the report work. HTH
Roxanne M. Seibert
Independent Consultant, VFP MCP

Code Monkey Like Fritos
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform