how to set SSRS Report parameters to be optional i.e Non-Mandatory field in SSRS 2005
Asked Answered
S

5

14

Please help me to set the SSRS Report parameters to be optional i.e Non-Mandatory field in SSRS 2005.

Simferopol answered 11/3, 2013 at 16:16 Comment(2)
There is no proprty call optional but you can DEFAULT value in optional parameters. if your datasource is store proc that would make it easy to develop.Northamptonshire
As @Northamptonshire suggested there is nothing like optional parameter. What you can do is modify your select statement to handle a case where parameter is NULL. Can you post your select statement ?Huldahuldah
P
4

As Hiten suggested there is nothing exactly we can call as optional parameters but if you want users to see this parameter as optional, use formula or case statements.

Parameterized stored procedures with some defaults or null value can be used to achieve the same goal.

Pali answered 11/3, 2013 at 16:49 Comment(1)
@Magier just for you, I fixed the link.Blok
K
21

Set the parameter to 'Allow null value' under General section. Null according to SSRS means it does not have to be set, thus making it optional.

Then post something like this in the predicate of your SQL syntax:

Where column = isnull(@Variable, column)

This lets the dataset know that if the variable is set then use it, else have an operator to have the value equal itself. I am certain this works in SSRS 2008 and 2012, not sure of 2005 but I would assume it may be there.

Kermis answered 11/3, 2013 at 22:29 Comment(0)
P
4

As Hiten suggested there is nothing exactly we can call as optional parameters but if you want users to see this parameter as optional, use formula or case statements.

Parameterized stored procedures with some defaults or null value can be used to achieve the same goal.

Pali answered 11/3, 2013 at 16:49 Comment(1)
@Magier just for you, I fixed the link.Blok
D
3

Further to djangojazz (dig the name, btw) - If the dataset is based on a SharePoint list (which doesn't support Query parameters, afaik), you can use the following formula in the Value box of the Filters section of the Properties dialog in whichever data region (e.g. Tablix) is invoking the parameter:

=IIf(IsNothing(Parameters!myParam.Value),Fields!myField.Value,Parameters!myParam.Value)

Darb answered 28/8, 2013 at 21:11 Comment(0)
B
1

Neither of these answers helped, nevertheless I found the solution here:

  1. Open the report for editing in Visual Studio.
  2. Expand the Parameters node and rename the affected parameter to ParameterName1.
  3. Set AllowBlank and Nullable to True if not already set.
  4. Deploy the report.
  5. Rename the parameter back to ParameterName.
  6. Deploy the report.
Barnaby answered 31/10, 2014 at 11:13 Comment(0)
V
1

After adding a parameter to your report and checking 'Allow Null Value',you can then add a filter to the dataset where the below expression is added to the value field for the filter

=IIf(IsNothing(Parameters!Param.Value),Fields!Field.Value,Parameters!Param.Value)
Viveca answered 26/10, 2015 at 22:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.