question

Rambo1-3047 avatar image
0 Votes"
Rambo1-3047 asked Joyzhao-MSFT commented

How to make dynamic parameter optional and hide if not selected

Good Day,

I am building a dynamic matrix reports in report builder (SSRS). For my first column I am using a dynamic parameter and specifying the values as column 1,2,3 and allows me to select a column to display by using this expression - =Fields(Parameters!ReportRows.Value).Value. For my second columns I am following the same process but specifying different columns A,B,C,D for the parameter using expression - =Fields(Parameters!ReportRows2.Value).Value. This allows me to select a column 1 from the first parameter and a column A from the second parameter.

PRM 1 PRM 2
column 1 column A Value
Product A Supplier 1 100

I want to make second parameter/column (column A) optional and if I don't select it then I want to hide it from the report.


Thanks for your assistance.



sql-server-reporting-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
0 Votes"
cooldadtx answered

Depending upon how flexible the parameter is you can either set a default value for it or set it as allowing null or blank. In most cases setting it to allow NULL lines up with your SQL query that you need. The downside is the UI requires the user to select a checkbox to specify it as NULL, at least for a web-based UI. Alternatively you could allow it to be blank. In this case it would need to be a string but shouldn't show a checkbox.

On the report generation side you can look at the values of the parameters and conditionally show/hide reporting stuff based upon whether it was provided or not.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Joyzhao-MSFT avatar image
0 Votes"
Joyzhao-MSFT answered Joyzhao-MSFT commented

Hi @Rambo1-3047 ,
Is your requirement similar to: When you select "True" in the drop-down of Parameter 1, the Parameter 2 is hidden; when you select "False" in the drop-down of Parameter 1, the Parameter 2 is visible.
Unfortunately, you cannot change a parameter's visibility during run time. Alternatively, you can control the second parameter's values based on the selected value of the first parameter.
In my case, Although I set "Allow Null Value" and "Allow Blank Value" for parameter 2[FilterValue],I cannot dynamically hide/show my parameter 2[FilterValue] based on the selection of parameter 1[RowGroupField].
137299-05.jpg
If I misunderstand what you mean,please feel free to correct me.
Best Regards,
Joy


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


05.jpg (54.2 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Joyzhao-MSFT,

You seem to have a similar issue to mine yes.

Im trying to hide my report rows2 parameter and the column if it is not selected, so making it optional basically. 137689-capture.jpg


0 Votes 0 ·
capture.jpg (55.5 KiB)

If the parameter is hidden then how would someone select it to enable it?

0 Votes 0 ·

Im trying to hide my report rows2 parameter and the column if it is not selected, so making it optional basically.

You cannot change a parameter's visibility during run time.
0 Votes 0 ·