Reporting Services - hide table column based upon report parameter

39

Solution 1

Set the Visibility for the column to an expression which will return true or false. This property can be found on in the Visibility tab on a TextBox for example.

Click the radio option for Expression and then your expression might look like

=Parameters!ShowColumn.Value

Solution 2

Use the visibility property of the column. This worked for me.

=iif(Parameters!ParameterName.Value = "TextValueOfTheParameter",False,True)

Solution 3

Tip: If the expression returns "False" then the column or row will be visible. If the expression returns "True", the expression will be hidden. This tricked me at first.

Solution 4

Let’s say my report(SSRS 2005) have 5 columns. And I want to show/ hide columns based on a parameter(multi select with all 5 column names) selected by user. do as following

1)Create a parameter of type string (ColumnVisibility is name of my parameter) with desired column names in labels for the 5 columns and INT number(01,02,03,04,05) respectively in the values in “Available Values” section of the parameter wizard.

2) Then Go to column Properties on design . Go to “visibility” and paste following

=iif(instr(Join(Parameters!ColumnVisibility.Value,","),"01")>0,false,true) 

3) repeat same for all the columns, by increasing the int value by 1..see following for example

2nd column

=iif(instr(Join(Parameters!ColumnVisibility.Value,","),"**02**")>0,false,true)

3rd column

=iif(instr(Join(Parameters!ColumnVisibility.Value,","),"**03**")>0,false,true)

And so on. For SSRS 2008, when you right click on the column you can see "Column Visibility" option. paste the code in "show or hide based on an expression" section for each column.

Solution 5

For some of my reports I've set the Visibility (Specifically the Hidden property) for the column to:

=IsNothing(Fields!Site.Value)

Note that this only works if the relevant field can be null in the underlying dataset, otherwise you will see the blank column.

Share:
39
BGPHiJACK
Author by

BGPHiJACK

Updated on November 28, 2020

Comments

  • BGPHiJACK
    BGPHiJACK over 3 years
      setInterval(() => {
        console.time("SendIt");
        for (let i = 0; i < 30000; i++) {
            process.send({
                type: 'test',
                id: i
            });
        }
        console.timeEnd("SendIt");
    }, 10000);
    

    Performing tests with process.send function, I found that my ram will drastically ramp up and stay that way for quite some time. Doesn't appear garbage collection is performed overly and newly added items aren't re-using allocation. Node.JS is latest and this is through Windows development haven't checked if Linux handles it differently.

    Wondering if this is normal behavior.

    My master is just listening like this,

     Cluster.on('message', (worker, message) => {});
    

    Don't believe their should be any reason for this climb in memory

    Full Code Example:

    /*jshint esversion: 8 */
    'use strict';
    
    const Cluster = require('cluster');
    if (Cluster.isMaster) {
      console.log(`Master ${process.pid} is online`)
      Cluster.schedulingPolicy = Cluster.SCHED_RR;
    
      for (let i = 0; i < 2 /*require('os').cpus().length*/ ; i++) Cluster.fork();
      Cluster.on('message', (worker, message) => {
        return;
      });
      Cluster.on('online', (worker) => {
        console.log('Worker ' + worker.process.pid + ' is online');
      });
      Cluster.on('exit', (worker, code, signal) => {
        console.log('Worker ' + worker.process.pid + ' is disconnected', code);
        Cluster.fork();
      });
    } else {
      console.time("Time");
      for (let i = 0; i < 1000000; i++) {
        process.send('test');
      }
      console.timeEnd("Time");
    }

    What happens is tests will boost Memory to around 2GB~ each worker and it will drop back down to about 500-600MB and sit.

    Where as if I ran the app without process.send use ram sits at: <20MB so just curious where's all this memory. ;)

  • Dan Appleyard
    Dan Appleyard about 15 years
    Thanks Josh, I am actually going to use the Hidden property (a sub property of visibility [at least in vs 2005]) for the column.
  • Renascent
    Renascent about 7 years
    What is "ReportA" here ? Dataset ?