One or the other parameter to consider

  • Hello Good Morning,

    I Have a report in ssrs 2012, I use Visual studio data tools to develop this report. in this report i need to add a parameter

    which is include states or exclude states

     am planning to give drop down list with three options Include, Exclude, ALL 

    when user selects include and the textbox values (next to  dropdown)  should include in query,  otherwise exclude works same way when user selects ALL then this parameter doesn't affect at all

    How can i write the query to make it happen the way as above for the parameter in where clause please?

    Thank you,
    sitaA

  • asita - Tuesday, April 17, 2018 8:45 PM

    Hello Good Morning,

    I Have a report in ssrs 2012, I use Visual studio data tools to develop this report. in this report i need to add a parameter

    which is include states or exclude states

     am planning to give drop down list with three options Include, Exclude, ALL 

    when user selects include and the textbox values (next to  dropdown)  should include in query,  otherwise exclude works same way when user selects ALL then this parameter doesn't affect at all

    How can i write the query to make it happen the way as above for the parameter in where clause please?

    Thank you,
    sitaA

    It sounds like you want to setup cascading parameters - the value of one parameters depends on what is selected in another parameter. Check this article:
    Add Cascading Parameters to a Report (Report Builder and SSRS)

    Sue

  • asita - Tuesday, April 17, 2018 8:45 PM

    Hello Good Morning,

    I Have a report in ssrs 2012, I use Visual studio data tools to develop this report. in this report i need to add a parameter

    which is include states or exclude states

     am planning to give drop down list with three options Include, Exclude, ALL 

    when user selects include and the textbox values (next to  dropdown)  should include in query,  otherwise exclude works same way when user selects ALL then this parameter doesn't affect at all

    How can i write the query to make it happen the way as above for the parameter in where clause please?

    Thank you,
    sitaA

    To be honest, it might be easier to have one parameter for whether it's an include or an exclude, and the other can just be a multi-select.   It will take a little more coding, but you could use dynamic SQL or IF statements in your stored procedure to handle what's needed.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

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

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