Hide duplicate row SSRS 2008

Let's say you have a SQL table with 2 columns. The first column is a name and the second column is a street address. For every address a name has, the name column is repeated for every row as such:

name          address
John Doe    100 West Main Street
John Doe    200 Apple Road
John Doe    300 Orange Circle
Todd Toe     123 Maple Drive
Todd Toe     543 Ridge Road

Now you wish to build a report to display this data, but you don't feel like grouping the name column in your SQL nor do you want to group the name column in your report.

So, in the tablix of your report, you create two rows. The first row displays the name column and the second row display an associated address. The problem is that you don't want to repeat the name row for each address like this:

John Doe                                                                                          
100 West Main Street
John Doe                                                                                          
200 Apple Road
John Doe                                                                                          
300 Orange Circle
Todd Toe                                                                                          
123 Maple Drive
Todd Toe                                                                                          
543 Ridge Road

You want it to look this:

John Doe                                                                                          
100 West Main Street
200 Apple Road
300 Orange Circle
Todd Toe                                                                                          
123 Maple Drive
543 Ridge Road

You can do this (without any grouping) by simply using the Previous expression of SSRS.

1) Right Click on your name row and choose row visibility.
2) Click the 'Show or hide based on an expression' radio button and click the expression button.
3) Enter the expression:
    =iif(Fields!name.Value = Previous(Fields!name.Value), True, False)

That's it!

 

Please follow and like us: