The report you want can be easily created with a report transformation see
The user interface has been updated since the above thread was created but the cited functions are the same.
Unfortunately the current user interface makes it difficult to write program flow control