locked
Parameter Default Values - Single/Multiple Values RRS feed

  • Question

  • I have a report where I would like to default the user selection by department.  Currently I am identifying the department of the user accessing the report and defaulting the department to this department.  However, I would like to default to the entire department result set if the person's department is IT. 

    I am trying to create an expression for the Department parameter so that it defaults to a single department if the user is non-IT otherwise all departments are selected.

    Expression I am trying to get to:

    =IIF(Parameters!InitialUserDept.Value <> 330, Parameters!InitialUserDept.Value, AllValues)

     

    Any help is much appreciated.

    Thanks,
    Sam

    Monday, July 19, 2010 3:21 PM

Answers

  • hello, you can do this by using a dataset to populate your default values

    something like this:

    select department_name  from department where 330 <> @dip
    union
    select department_name from department where userdept = @dip

     

     

    • Proposed as answer by Gayathridevi.msit Tuesday, July 20, 2010 7:45 AM
    • Marked as answer by Challen Fu Tuesday, July 27, 2010 11:02 AM
    Monday, July 19, 2010 3:59 PM
  • you can't do this with an expression. you should create a dataset like :

     

    select * from Departmans

    where case when @depValue is not 330 then depValue=@depValue else 1=1 end

     

    in this case you should connect this datase to the departman parameter's default value section as get from query.

    • Proposed as answer by Challen Fu Thursday, July 22, 2010 7:28 AM
    • Marked as answer by Challen Fu Tuesday, July 27, 2010 11:02 AM
    Tuesday, July 20, 2010 6:52 AM

All replies

  • hello, you can do this by using a dataset to populate your default values

    something like this:

    select department_name  from department where 330 <> @dip
    union
    select department_name from department where userdept = @dip

     

     

    • Proposed as answer by Gayathridevi.msit Tuesday, July 20, 2010 7:45 AM
    • Marked as answer by Challen Fu Tuesday, July 27, 2010 11:02 AM
    Monday, July 19, 2010 3:59 PM
  • you can't do this with an expression. you should create a dataset like :

     

    select * from Departmans

    where case when @depValue is not 330 then depValue=@depValue else 1=1 end

     

    in this case you should connect this datase to the departman parameter's default value section as get from query.

    • Proposed as answer by Challen Fu Thursday, July 22, 2010 7:28 AM
    • Marked as answer by Challen Fu Tuesday, July 27, 2010 11:02 AM
    Tuesday, July 20, 2010 6:52 AM