Search code examples
reporting-servicesvisual-studio-2017ssrs-2017

SSRS Report - Badges


Is there an easy way to do a page of badges in an SSRS report? I am looking at 2 across and 3 down per page based on a list. I have built one so far of a single column using a list box but the problem is that it is not advancing to the next record and shows me the same record over and over until I get to the end of the count of total records in the dataset so I know I am doing something wrong. I am using Visual Studio 2017


Solution

  • I use a matrix when I am making a grid with boxes that go across and down.

    First I add a ROW_NUMBER to the query to have the order in which to show the records. I subtract 1 so the values start with 0.

    SELECT *, ROW_NUMBER()OVER(ORDER BY EFF_DATE) - 1 ROW_NUM 
    FROM BLAH_BLAH...
    

    Then in SSRS, add 2 Calculated Fields to the dataset with the ROW_NUM.

    The first is named ROW. It will have an integer with the row that the record will end up in.

    =INT(Fields!ROW_NUM.Value / 2)
    

    The second is COLUMN that will give the a column number.

    =Fields!ROW_NUM.Value MOD 2  
    

    Then in the matrix, set the grouping based on the calculated fields.

    COLUMN GROUP Group and Sort by COLUMN

    ROW GROUP Group and Sort by ROW

    The 2 can be changed to use whatever number of columns is needed.