Search code examples
sql-serverreporting-servicessql-server-2012ssrs-2016

Pass a table value to a linked report filter - SSRS 2016


I have a report that has summary data and graphs that summarizes the data year by year. I also have a summary table that shows values by year and by type. When the user clicks on the graph or table it will take them to another report that has all of the detail data from the summary. I am able to pass parameters from each report without issues.

What I'm looking to do is be able to click on a column in the table or graph that will filter based on what I click on. If I click on the year 2017 in my table, I want to see the 2017 data.

Is there a way to create a filter or pass data to a parameter by clicking on a field?

If I click this date, only show me these records

enter image description here


Solution

  • Yes - you can pass data from your main report to a parameter in your drill trhough report so that it filters the data for whatever you clicked on.

    On your detail report, add a parameter to your detail report for the filter - in your example it would be for the YEAR.

    You can add the filter to the query or in the Filter tab of the dataset. Putting it in the query will usually work faster than in the dataset.

    In the main report, you Enable a Go To Report Action to the Year in the text box properties and select the detail report to open. The you Add your YEAR parameter in the Name column and select your YEAR column in the Value column.

    enter image description here

    Here's some more info on Drillthroughs:

    https://learn.microsoft.com/en-us/sql/reporting-services/report-design/add-a-drillthrough-action-on-a-report-report-builder-and-ssrs?view=sql-server-2017

    https://learn.microsoft.com/en-us/sql/reporting-services/report-design/drillthrough-reports-report-builder-and-ssrs?view=sql-server-2017