locked
Multiple choice drop down; choices in header ... how? RRS feed

  • Question

  • Hi

    I have a multiple choice drop down filter in my report and I would like to show in the header when the user has choosen "Select All" or when the user has selected a few items, and then have it printed out in the report header.

    Another thing is that, if it's at all possible, if the user chooses more than 5 items then only show jsut 2 or 3 of them and end it with (...) or something.

    Thanks in advanced.


    jea
    Wednesday, November 3, 2010 3:12 PM

Answers

  • Hi,

    You can use parameters!ParameterName.Count function and compare it with DistinctCount(Fileds!FieldName.Value) to determine if user has selected all values or not. If both counts are same then you can print "All selected" in header. You can think of some more tricks to print selected values like you can make another dataset to query the names of selected values and using IN clause by passing multi valued parameter values. May be some more efficient way but this comes to my mind on the fly.

    Hope it will lead you to some desired result.

    Thanks

    • Proposed as answer by Tony Chain Friday, November 5, 2010 8:44 AM
    • Marked as answer by Tony Chain Thursday, November 11, 2010 4:57 AM
    Wednesday, November 3, 2010 3:43 PM

All replies

  • Hi,

    You can use parameters!ParameterName.Count function and compare it with DistinctCount(Fileds!FieldName.Value) to determine if user has selected all values or not. If both counts are same then you can print "All selected" in header. You can think of some more tricks to print selected values like you can make another dataset to query the names of selected values and using IN clause by passing multi valued parameter values. May be some more efficient way but this comes to my mind on the fly.

    Hope it will lead you to some desired result.

    Thanks

    • Proposed as answer by Tony Chain Friday, November 5, 2010 8:44 AM
    • Marked as answer by Tony Chain Thursday, November 11, 2010 4:57 AM
    Wednesday, November 3, 2010 3:43 PM
  • Well it kinda helped. Thanks!!
    I did something like this:

    =IIF
     (
      Parameters!Company.Count = Sum(Fields!CountCompanys.Value, "DSCompany")
      , "All Selected"
      , Parameters!Company.Count & " selected companies"
     )

     

    Quick ... maybe dirty ... but it does the work.

    One thing I would like to add is that if the user selected say 3 companies ... then those company names should be printed out in the header but if he selects more then it shoud just say "35 companies selected".


    jea
    Friday, November 5, 2010 10:20 AM
  • Hi,

    You need to write some logic to query selected companies as a single string and then add expression in ssrs like:

    =IIF(Parameters!Company.Count = 3, Fields!CompanyNames, CSTR(Parameters!Company.Count) & " companies selected.")

    Thanks

    Friday, November 5, 2010 11:21 AM