Forum Discussion

anmolmalviya05's avatar
anmolmalviya05
Super User
2 years ago

Parameters in SSRS report

Hello Everyone,

I have created a ssrs report using below query

Select * from orders o
where o.ordername in @ordername and o.productname in @productname

 

I have two parameter in my ssrs report for order name and product name

 

When I run the report i have to select any value in both the parameters, I want that report should be independent of the parameters, that is even if i didnt select any value in parameters it should run, and if i keep any one blank and select a value in another then also the report should run

3 Replies

  • What do you imagine shoul be the SQL query, if one or both parameters are blank?

     

    Are these multiselect parameters? If so, I dont believe you can leave multiselect parameter blank. Probably what you want is to have Select all as default in multiselect parameter, effectively not filtering query at all. For example, you choose all product names, it is the same as if you didnt filter according to product names at all.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, anmolmalviya05 

    You can set default values for the parameters as shown below:

     

    Parameter_OrderName is the dataset used to get the parameter OrderName.


    When you run the report, it will default to select Select All:

     

     

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Fen Ling,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.