locked
Display text based on Parameter selection RRS feed

  • Question

  • I have created a text box in SSRS, based on a single parameter selection (Parameters!choice.Value) i want to display some text.

    For example the parameter has 3 possible selection A, B and C


    So....


    =IIF(Parameters!choice.Value = "A", "Apple", ""
    or IIF(Parameters!choice.Value = "B", "Banana","Carrot"))

    but when i view the report, i get and "ERROR" in the text box

    What am I doing wrong

    Friday, November 6, 2009 10:04 AM

Answers

  • Hi,

    try giving it as...


    =IIF(Parameters!choice.Value = "A", "Apple",  IIF(Parameters!choice.Value = "B", "Banana","Carrot"))


    Best Regards,
    Azhar
    • Marked as answer by SQL_1980 Friday, November 6, 2009 10:27 AM
    Friday, November 6, 2009 10:15 AM

All replies

  • Hi,

    try giving it as...


    =IIF(Parameters!choice.Value = "A", "Apple",  IIF(Parameters!choice.Value = "B", "Banana","Carrot"))


    Best Regards,
    Azhar
    • Marked as answer by SQL_1980 Friday, November 6, 2009 10:27 AM
    Friday, November 6, 2009 10:15 AM
  • Try this,

    =SWITCH(Parameters!choice.Value = "A", "Apple", 
                   Parameters!choice.Value = "B", "Banana", 
                   Parameters!choice.Value = "C", "Carrot")
    Rajesh Jonnalagadda http://www.ggktech.com
    Friday, November 6, 2009 10:28 AM
    Answerer