A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
Yes. A group variable is the right fit for this scenario.
A group variable is calculated once per group instance and can be used in expressions from nested child groups. That matches the requirement when the outer group is Instructor and the child rows are the student’s courses.
A workable approach is:
- Define the outer group by Instructor.
- Create a group variable on that Instructor group to hold the instructor value shown above the black line.
- On the child group or detail rows that list courses, add a group filter that compares the course Instructor field to that group variable.
In Report Builder / SSRS:
- Open the report in Design view.
- In the tablix, select the Instructor parent group.
- Open Group Properties for that group.
- Define a group variable for the instructor value.
- Group variables are intended for expressions scoped to the group and accessed from nested groups.
- Then select the child row group or detail group that displays the courses.
- Right-click it in the Grouping pane and select Group Properties.
- Select Filters.
- Add a filter:
- Expression: the dataset field for the course instructor
- Operator:
= - Value: the Instructor group variable
- Select OK.
This keeps only the course rows whose instructor matches the current Instructor group instance.
This approach is consistent with how SSRS processes grouped data:
- Filters can be applied at the data region group level.
- Group variables are available to nested child groups.
- Group expressions are evaluated after filters are applied to the data in the report.
If the report must behave differently only when the user selects group by Instructor, apply this filter only on the Instructor-based grouping path. If the same tablix is reused for other grouping choices such as Major, avoid applying the Instructor-match filter there, because it would remove valid rows for those other groupings.