#1 2019-01-29 00:37:14

aditi.raiter
Member
Registered: 2018-05-01

Passing value of a selected parameter

Is it possible to pass the value of selected parameter to another parameter in the same report?

Example : If a report has 2 Data source parameters - country and state. If I select country = 'US' , the parameter value would additionally get passed to state report parameter so that it can append an  extra condition to get states where country is 'US'. This way,  in the list drop down the user gets to select states of US and not of other countries.

Thanks
Aditi

Offline

#2 2019-01-29 07:54:08

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Passing value of a selected parameter

Hi Aditi,

yes, this is possible with datasource parameters. These are called cascading parameters.

Usually you would write your parameter2 query as something to the extend of:
Select key_col, val_col from mytable where some_col = $P{param1}
Also, please note this: Don't forget to add myValue as a dependent parameter: "Parameter properties" -> "Depends on"

Check here:
https://forum.reportserver.net/viewtopic.php?id=1344
and here:
https://reportserver.net/en/guides/admi … cascading/

Regards,
Eduardo

Offline

#3 2019-01-29 14:52:19

aditi.raiter
Member
Registered: 2018-05-01

Re: Passing value of a selected parameter

That helps. Thanks so much !

Offline

#4 2019-05-09 13:03:47

michigunesh
Member
Registered: 2018-12-20

Re: Passing value of a selected parameter

Hi,

Just to extend this scenario of Cascading prompt, I have a requirement where User can select multiple values. Would you be able to help how this could be achieved as it seems like ReportServer only Supports Single Selection for Cascading Prompts.

Thanks

Offline

#5 2019-05-13 08:33:12

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Passing value of a selected parameter

Hi michigunesh,

if you need multiple values, you can write a different query:

instead of
Select key_col, val_col from mytable where some_col = $P{param1}

you could write:

Select key_col, val_col from mytable where some_col = $X{IN, column, param1}

or

Select key_col, val_col from mytable where some_col = $X{NOTIN, column, param1}

More information on parameters:
https://reportserver.net/en/guides/admi … arameters/

Regards,
Eduardo

Offline

#6 2019-07-20 22:22:24

michigunesh
Member
Registered: 2018-12-20

Re: Passing value of a selected parameter

Thanks a lot, that helped.

Offline

Board footer

Powered by FluxBB