none
Show/Hide multiple Tables based on Parameter value

    Question

  • I'm trying to show table based on parameter inputs (2 parameters).
    1)- if the first one is blank and second has the user input, it should display table 1
    2)- if the second one is blank and first has the user input, it should display table 2

    3)- if both parameter has value inserted by user , then it should display table 3

    I get stuck in third condition (for table 3), where both parameter has values in it.

    Expressions for these tables are (under visibility ):

    

    Table 1: 

    =Parameters!Store.Value<>"" And Parameters!Sku.Value=""

    Table 2:

    = Parameters!Store.Value="" And Parameters!Sku.Value<>""

    Table 3:

    = Parameters!Store.Value="" And Parameters!Sku.Value=""

    Please let me know mistake in my expressions if any or suggest solution as Im new to SSRS.

    Thanks.


    ZK

    Monday, March 04, 2013 7:54 PM

Answers

  • Hi,

    TRY this

    Table 1: 
    =IIF(Parameters!Store.Value<>"" And Parameters!Sku.Value="", FALSE , TRUE )
    Table 2:
    = IIF(Parameters!Store.Value="" And Parameters!Sku.Value<>"", FALSE  ,TRUE ) 
    Table 3:
    = IIF(Parameters!Store.Value<>"" And Parameters!Sku.Value<>"", FALSE , TRUE )

    Regards

    http://simplesqlserver.wordpress.com


    Dj's | Please mark as answered or vote helpful if this post help resolved your issue. Thanks!

    • Proposed as answer by Tom Jenkin Monday, March 04, 2013 9:36 PM
    • Marked as answer by SQL_Admirer Monday, March 04, 2013 9:47 PM
    Monday, March 04, 2013 9:28 PM

All replies

  • Hi,

    Select each Tablix one by one and choose on properties-> hidden -> then expression :

    Table 1: 
    =IIF(Parameters!Store.Value<>"" And Parameters!Sku.Value="", TRUE, FALSE )
    Table 2:
    = IIF(Parameters!Store.Value="" And Parameters!Sku.Value<>"", TRUE, FALSE ) 
    Table 3:
    = IIF(Parameters!Store.Value="" And Parameters!Sku.Value="", TRUE, FALSE)

    Regards

    http://simplesqlserver.wordpress.com


    Dj's | Please mark as answered or vote helpful if this post help resolved your issue. Thanks!


    • Edited by Djallal.E Monday, March 04, 2013 8:24 PM
    Monday, March 04, 2013 8:23 PM
  • I'm still getting two tables get populated/shown after entering value for both parameters


    ZK

    Monday, March 04, 2013 9:05 PM
  • I think there is problem with expression, not sure what could be..

    ZK

    Monday, March 04, 2013 9:06 PM
  • Hi,

    Are 2 tables showing no matter the combination? If param1 has a value and param2 does not what happens, vice-versa and what happens if both have a value?

    Monday, March 04, 2013 9:24 PM
  • Hi,

    TRY this

    Table 1: 
    =IIF(Parameters!Store.Value<>"" And Parameters!Sku.Value="", FALSE , TRUE )
    Table 2:
    = IIF(Parameters!Store.Value="" And Parameters!Sku.Value<>"", FALSE  ,TRUE ) 
    Table 3:
    = IIF(Parameters!Store.Value<>"" And Parameters!Sku.Value<>"", FALSE , TRUE )

    Regards

    http://simplesqlserver.wordpress.com


    Dj's | Please mark as answered or vote helpful if this post help resolved your issue. Thanks!

    • Proposed as answer by Tom Jenkin Monday, March 04, 2013 9:36 PM
    • Marked as answer by SQL_Admirer Monday, March 04, 2013 9:47 PM
    Monday, March 04, 2013 9:28 PM
  • This time it works like a magic, though bit slow while retrieving.

    Thanks Djallal!


    ZK

    Monday, March 04, 2013 9:48 PM