Search code examples
reporting-servicesssrs-tablixssrs-2016

Filter SSRS Tablix into 2 columns that updates dynamically for menu page links


I have this SSRS report which I'm using as a menu page, with an action assigned to each report name to take the user to it. But as you can see with more and more reports being added, it's slipping over the page.

enter image description here

I want to create a menu page which has the report names in two columns and don't know how to go about this.

In design view I have one tablix which currently looks like this

enter image description here

With this code in the dataset:

SELECT [ReportOrder],[ReportID],[ReportPath],[Folder],[ReportName],[ItemType]FROM [dbo].[DimSSRSReportList] WHERE Folder = 'Customer Services' AND ItemType = 'Report'

My initial thought was to have two Tablix side by side and filter the left to top 50% and right to bottom 50% but this is just repeating the same reports on either side

enter image description here Can anyone help?

Thank you muchly

--------EDIT!--------

I can't quite get the column grouping using the MOD function to work. I've added the expression to the top and it's returning everything as 1. This is how it currently looks

enter image description here


Solution

  • This is an extension to Hannover's answer but it should make things easier as there are no calculations in the report design.

    Change the dataset query to the following...

    SELECT ReportOrder, ReportID, ReportPath, Folder, ReportName, ItemType
        , CAST(((ROW_NUMBER() OVER(ORDER BY ReportOrder)-1)  / 2) as INT) as RowN
        , ((ROW_NUMBER() OVER(ORDER BY ReportOrder)-1) % 2)  as ColN
    FROM [dbo].[DimSSRSReportList] 
    WHERE Folder = 'Customer Services' AND ItemType = 'Report'
    

    If you run this query in SSMS you'll see you get data similar to this simplified exmaple

    ReportOrder, ReportName, RowN, ColN
    1            FirstReport    0     0
    2            SecondReport   0     1
    3            ThirdReport    1     0
    4            FourthReport   1     1
    5            FifthReport    2     0
    

    Next Add a matrix, and set row group to group on RowN and the column group to group on ColN

    That should be it.