SQL Server Performance

Report Paramters

Discussion in 'SQL Server Reporting Services' started by darranp, Jun 8, 2004.

  1. darranp New Member

    Hi, Sorry guys but I'm new to this!

    I'm trying to add a select on my report i.e. select a company name from the drop down box and then run the report to show only the details for that company but once I added a report parameter it shows the drop down list but no matter what it always returns ALL the data!

    What am I doing wrong? what else do I need to do to make this work?

    Thanks!
  2. gpl New Member

    In your data definition section (excuse me Im at home and I dont have RS loaded so I cant see exactly what the tab is called) - you need to refer to your parameter ie
    select field1, field2, field3, field4, ..... fieldn
    from mytable where comanyname = @ParamCompanyName

    Graham
  3. darranp New Member

    Thanks Graham, I've already managed to get that far but that will only provide a text box to allow you to TYPE the name of the company name (selection criteria) I won't to be able to select the company from the drop down box and then view the report against the selection criteria from the drop down box.

    I'm sure it's simple! but I can't for the life of me work out how to do it! I can manage to get the drop down box to display with the company names but as soon as I select a company name and click view report it returns all the companies and not the selection!

    If I use the:

    "select field1, field2, field3, field4, ..... fieldn
    from mytable where comanyname = @ParamCompanyName"

    it does perform the correct select but of course this way requires a typed name NOT a selected name.

  4. darranp New Member

    The problem seems to be as soon as I select Availible values: from query as apposed to non queried it doesn't acutally do the select it returns everything! and of course I'm sure you need to have the from query option activated in the report parameters dialog box.

    any more ideas on why that little bit doesn't work?
  5. applearner New Member

    Darranp

    Have you got the dropdown box for selecting company names!? If not, its very simple to get.

    Goto reports from main menu and click report parameters. There you can assign values[type/getvalues by query] for company names in "Availbale values" table. Which has Label/Value colums. This may solve your problem.
  6. darranp New Member

    applearner I'm doing all this and the drop down box appears and when I select a company name and view it returns ALL the data and not just the data for that company!

    Any other ideas anyone?
  7. einstein_cao New Member

    You can add HyperLink to Combo Items and like it to self page.

    If need you can trans para to another dataset with your choice on Combo
  8. BabuYb New Member

    I can't figure your problem I had used both based and non-query based list for selection and successfully did "comanyname = @ParamCompanyName" (with and without default value. May be you should check the parameter mapping in the data source properties and ensure that the sql parameter is mapped to report parameter.

    Bhaskar Babu
  9. suganthi_r80 New Member

  10. ginn New Member

    i'm too facing a similiar problem..
    I am to let a user select start and end date then load respective reports..
    ANyone know how to?
  11. vaxman New Member

    As mentioned above, change your select query to:

    select field1, field2, field3, field4, ..... fieldn
    from mytable where comanyname = @EndDate

    RS will automatically generate an input text box called enddate for the user to enter.

Share This Page