How to make a column invisible in an ssrs matrix

8.5k views Asked by At

I have an ssrs matrix , the design of which looks like this :

enter image description here

The sql query used in the above dataset looks like this :

select [YEAR], [MONTH] as MONT , ProductName, NumberofSales from XYZ ;

When the report is run , My output looks like this :

enter image description here

Here , the Column Names 9 , 10 correspond to the months 9 - September and 10 - October.

Change shows the difference in numbers between the month and the previous month . example : number of sales in october - number of sales in september.

I would like to remove the column that I have circled in the above picture . Could you please let me know how I can do this . ??

I already tried right clicking the Change column and changing the visibility property, by adding an expression to look soomething like this :

=(Parameters!UserSelectedDate.Value=Fields!MONT.Value)

But that gives me an entire blank space for the Change column like this :

enter image description here

But I do, not want to see the blank space. I would like to remove the column completely. Please let me know if it is possible.

3

There are 3 answers

0
Konrad Z. On

I don't know, why it shows blank space, but here is how I handled this problem:

  1. Choose "column visibility" property of column "Change" enter image description here
  2. Then I added expression for hiding column: =IIF(Month(Fields!Date.Value)=Parameters!UserSelectedDate.Value,True,False)

And when I select report parameter to 1 and preview the report, it hides Change column for month 1: enter image description here

1
Ilya Fetisov On

This answer works only for matrixed (varied count) columns. But in all reports client want to group report data dynamicly and select column that one want to see. So if I have matrix for example with columns -

[Store] [Good] [Amount Jan] [Amount Feb].... [Amount Dec]

I can hide any column with Amount but If I right click on column Store - No option in menu- Column properties and option Column Visibility - Disabled. If apply visibility to cells - you'll see a blank space.

0
user16607470 On

I've looked for an answer for this issue and was frustrated that I could not find any. Then I found a workaround for this issue, I decided to share this.

You have to create column groups for all columns, which you would like to Show/Hide. For this matter you have to take or create one or more attributes in you ResultSet, which contain a constant value, so that the columns will not be later propagated.

enter image description here

After you created a new Column Group (as Adjacent Before/After)

enter image description here

you can put there the columns, which you like to Hide/Show.

enter image description here

After that you can use the property "Column visibility". It works just fine for me.

enter image description here