This StackOverflow answer is one way to achieve this:
Row aggregation in SSRS 2005
The disadvantage of this method is that it uses common variables in the code module, which can cause concurrency problems if the report is hosted on the network.
I also ran into another problem:
Create a custom function, such as GetStudentList (TeacherId As Integer, ConnectionString As String), which is designed to return a list of students based on the specified teacher.
You can then write this function to open a database connection, run a query, process the results, and then return them. But this means opening a connection and executing a query for each line, which seems like a lot of overhead for this type of formatting (not to mention the need to pass in the connection string).
This is largely based on an article by Exchange experts .
Aaronseb
source share