Imad,
Let's start with many-to-one relationships where a student can have only one course and a course has one lecturer. In this case you could define a few shortcut attributes on Student to point to related information in Course and Lecturer objects:
Student.CourseName: shortcut to Student.Course.CourseName
Student.CourseDate: shortcut to Student.Course.CourseDate
Student.LecturerFirstName: shortcut to Student.Course.Lecturer.L_FirstName
Student.LecturerLastName: shortcut to Student.Course.Lecturer.L_LastName
Next, you could define a query to find all students who take a course with a given name on a given date:
FIND Student WHERE EXISTS Course WHERE (Course.CourseName CONTAINS ?'Course name' AND Course.CourseDate = ?'Course date ') ORDER BY Student.CourseName, Student.LastName
'Course name' and 'Course date' in this query are the parameters that the user can enter before the query is executed. The query will list all students taking the first course, then all students taking the second course, etc. All you would have to do now is to specify the following attributes (including the shortcut attributes) of Student to be displayed for the query: FirstName, LastName, CourseName, CourseDate, LecturerFirstName, LecturerLastName.
If the relationship between Student and Course is many-to-many you cannot create shortcut attributes on Student pointing to Course because a shortcut would not know to which related Course instance it should point. Therefore the approach to query will be different. Basically, the idea is to show all courses of interest with a list of students under each course. The query would then search for courses:
FIND Course WHERE Course.CourseName CONTAINS ?'Course name' AND Course.CourseDate = ?'Course date ' ORDER BY Course.CourseDate, Course.CourseName
The next step is to design a presentation for object Course (see the Aware IM User Guide for details on designing object presentations). It should show course name, date, and lecturer name in the Details section as well as a list of student names. The student list can be shown using a sub-presentation designed for object Student with the following query:
FIND Student WHERE Student.Course = Course ORDER BY Student.LastName
The last step is to select the newly designed presentation for object Course to display the results of the query on Course.
Please refer to report 'Member details' in the Library sample application for an example of using sub-reports (reports and presentations are very similar).