0

I am tasked with creating a report in SSRS that can display data covering anywhere from 1 week up to 52 weeks.

What I am trying to avoid is writing a huge query that will pull all 52 weeks worth of data and have it show on the report, unless the user wants that data to appear.

So if the user wants January 1st - February 1st it will only show 6 columns of data instead of all 52 columns. How would I do something like that?

David Tansey
  • 5,813
  • 4
  • 35
  • 51
user3394606
  • 13
  • 1
  • 7
  • The question is a little broad so this will be too... Using parameters you can have the user input which time interval he wants to pull. And on the report you can setup within a Matrix a Column Group and group by your Week. It will only show the weeks that exist in your dataset. – mxix Jun 14 '16 at 17:06
  • 1
    Do you want to dynamically add rows (as per your title) or dynamically add columns (as per your body text)? – Rich Benner Jun 14 '16 at 20:10
  • Sorry, I want to add columns. So column 1 = Week1, Column 2 = Week2, Column 3 = Week 3, etc. But I don't want it to display 49 columns of blank data if they only select 3 weeks of data to view – user3394606 Jun 14 '16 at 21:26

3 Answers3

0

Easy - you need to use a Matrix.

A grid gives you a fixed number of columns and many rows. A matrix gives you many columns and many rows.

BIDeveloper
  • 2,628
  • 4
  • 36
  • 51
0

Try this How to Create SSRS Report with Dynamic Columns

Rajashekhar
  • 75
  • 11
0

Create column grouping on your tablix, for example you have column WEEK and you are bringing data from 1st Jan to 1st Feb.

Column grouping on column WEEK will generate only 5 columns if you have data for every week.