Hey ChiTownDivaus,
You can't use a join condition in conjunction with the instructor data in the report header. By the time you're trying to return the instructor records in the header, the report hasn't actually processed the records to know what they are yet.
To accomplish what you're trying to do, let's forget about the join functionality, and go back to the beginning.
Right click the Report Header, and Insert Section Below. Invert Report Header a and b, so that your new section is now Report Header a.
Create a subreport into which you pass the {?Primary Sort} parameter. Place the subreport into Report Header a.
In the subreport, group by Location. In the group footer of the subreport, place the following formula:
//{@ParameterData}
WhilePrintingRecords;
Shared StringVar Name;
Shared StringVar PrimarySortOrder;
If Length(PrimarySortOrder) + Length({Table.Location}) + 2 > 255
Then PrimarySortOrder := '***'
Else PrimarySortOrder := PrimarySortOrder + ', ' + {Table.Location};
If Left(Name,8) <> 'Too many'
Then
If Length(Name) + Length({Person.Pers_First_Name}) + Length({Person.Pers_Last_Name}) + 2 > 255
Then Name := "Too many instructors to list"
Else
Name := Name + ', ' + {Person.Pers_First_Name} + ' ' + {Person.Pers_Last_Name}
Else Name := Name;
Back on the main report, in Report Header b, insert:
//{@ParameterDisplay}
WhilePrintingRecords;
Shared StringVar PrimarySortOrder;
If InStr(PrimarySortOrder,'***') > 0
Then Join({?Name},', ')
Else
Mid(PrimarySortOrder,2)
...and...
//{@InstructorDisplay}
WhilePrintingRecords;
Shared StringVar Name;
Local NumberVar Counter;
StringVar Display;
For Counter := 1 to Count({?Name}) Step 1 Do
(
Display := Display & Name[Counter] + ", "
);
Mid(Name,2);
We're using {@ParameterDisplay} because the order of the parameter values and the order of the instructors derived from the subreport are ignorant of one another. So, we have to sort the parameter values so that the parameter values are alphabetical, as per the subreports group order. Thus, you should avoid instructors being assigned to the wrong location.
All the best,
Naith