Optional cascading parameter problem

  • This is in SSRS 2012

    I'm having problems trying to make a cascading parameter optional. The report requirements are that the user can enter an employee ID and run the report, or enter part/all of the last name to get a drop down list of employees to select from.

    Right now I can't get it configured so an ID can be entered and then hit view report. When I do that it throws an error requesting a value be entered for the 'Select Employee From List'.

    The Employee parameter (which is behind the 'Select employee from list') is setup to get it's values from a query. The query gets name and ID values based upon the string entered in the 'last name contains'. I have tried setting up the Employee parameter to allow NULL and/or blank values. I have tried setting up a default value for the parameter. When I put in a default for the parameter, I still had to actually select the default in order for it to work.

    I also tried setting the 'Last Name Contains' variable so that it can be NULL and checked the NULL which did not change anything.

    What am I missing?

  • I'd probably handle this by making the query for Select Employee From List Parameter an expression something like this:

    =IF(Parameters!EmployeeID.Value = String.Empty, "Select ID, Name From dbo.Employee where Name Like '%'" & Parameters!Name.Value & "'", "Select " & Parameters!EmployeeID as ID, 'None' As Name")

    OR

    ="Select ID, Name From dbo.Employee where " & IF(Parameters!EmployeeID.Value = String.Empty, " Name Like '%'" & Parameters!Name.Value & "'", " ID = " & Parameters!EmployeeID.Value)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply