locked
Step by step adding parameters RRS feed

  • Question

  • I am trying to add 4 parameters to a report.  I have 2 questions:

    1) Once the parameters are created in the Design window, is there another step or am I done?

    2) I have created 2 of the parameters.  The second one is not working properly because the drop down list shows duplicate values (i.e. one value for each record, instead of one instance of each value.).  How can I fix this?

    I've been searching online but haven't found answers to these questions yet.

    Thank you very much!

    Thursday, May 2, 2013 3:19 PM

Answers

  • Hi,

    For the First: You have to add these parameters in your report dataset query for filter the report's data.

    Please have a look on these links:

    http://www.youtube.com/watch?v=vB9iDurRtRM

    http://dhananjayspeaks.wordpress.com/2012/01/24/how-to-using-parameter-in-a-report-in-ssrs-2008/

    I hope it will help.


    Regards

    Vishal

    Thursday, May 2, 2013 3:26 PM
  • For your second question, I assume you need duplicate values on that field for another part of your report?  If so, then add a separate dataset where the query just pulls back that column with SELECT DISTINCT (column name) rather than just SELECT (column name).  Use this separate dataset to create the parameter and you will get unique values in the drop down list.
    • Proposed as answer by Charlie Liao Friday, May 3, 2013 8:21 AM
    • Marked as answer by Charlie Liao Thursday, May 9, 2013 9:27 AM
    Thursday, May 2, 2013 9:25 PM
  • 1) If you have configured everything correctly, yes that is fine. Also, depends where you want to filter the parameter. For example , if you are passing the parameter selected value as a parameter to another parameter, then it is fine. In case you are planning to filter data in design, then you need to add the filter condition on the report design.

    2) The dataset that is bound to the parameter, check its query by running it in SSMS . Does that return unique values.. if not please modify the query to return unique values. The parameter only shows what is being queried by the dataset queries.

    Let us know if you need any other info.

    - Girija


    Thursday, May 2, 2013 11:49 PM

All replies

  • Hi,

    For the First: You have to add these parameters in your report dataset query for filter the report's data.

    Please have a look on these links:

    http://www.youtube.com/watch?v=vB9iDurRtRM

    http://dhananjayspeaks.wordpress.com/2012/01/24/how-to-using-parameter-in-a-report-in-ssrs-2008/

    I hope it will help.


    Regards

    Vishal

    Thursday, May 2, 2013 3:26 PM
  • For your second question, I assume you need duplicate values on that field for another part of your report?  If so, then add a separate dataset where the query just pulls back that column with SELECT DISTINCT (column name) rather than just SELECT (column name).  Use this separate dataset to create the parameter and you will get unique values in the drop down list.
    • Proposed as answer by Charlie Liao Friday, May 3, 2013 8:21 AM
    • Marked as answer by Charlie Liao Thursday, May 9, 2013 9:27 AM
    Thursday, May 2, 2013 9:25 PM
  • 1) If you have configured everything correctly, yes that is fine. Also, depends where you want to filter the parameter. For example , if you are passing the parameter selected value as a parameter to another parameter, then it is fine. In case you are planning to filter data in design, then you need to add the filter condition on the report design.

    2) The dataset that is bound to the parameter, check its query by running it in SSMS . Does that return unique values.. if not please modify the query to return unique values. The parameter only shows what is being queried by the dataset queries.

    Let us know if you need any other info.

    - Girija


    Thursday, May 2, 2013 11:49 PM
  • Thank you, everyone.  I was able to fix the parameter using the helpful tips you provided!

    Tuesday, May 7, 2013 2:44 PM
  • Step by step adding parameters is called as "Cascading" and can be achieved in main data set in Where condition statement... In your case if u r using 4 parameters  let say @a, @b, @c, @d so These parameter needs to be bind with respective column fields from database tables. This all is parameter creation afterword you have to create individual data set (i.e sub datasets which will give distinct values) for all above parameters.
    Wednesday, May 8, 2013 10:45 AM