Searching existing dataset gor a value

  • Hi

    I am brand new in working with reporting services.

    I've got a list of customers in a populated dataset which is used in a table on the report.

    The report also receives a customer id as parameter.

    If this parameter has a value of > 0, I want the report to look for the customer id in the existing dataset and display the customer's name somewhere on the report.

    If not, i want to display another customer's detail from the dataset where the level field = 1 (there can only be 1 in the dataset).

    Is there a way to do this without querying the db more than once.

  • I think the main concept that will solve your problem is the difference between query-based parameters and report-based parameters. Any parameter that is part of the query statement for the DataSet (i.e. WHERE MyColumn = @MyParameter) is a query-based parameter, and every time that parameter value changes, the query must run again.

    A report-based parameter is added to the report design by using the Report > Report Parameters menu. Define the parameter there, and only there, and then the query does not have to run every time that you select a new value for it.

    Of course, this means that the query must run un-filtered for that value and return all rows that match other criteria, allowing the report parameters to apply the filter after the report runs.

  • Thanks, I'll give it a try

  • I should have asked which version of Reporting Services you are running. The path to the report-only parameters (aka report filters) is quite different in 2005 compared to 2008.

    In 2005 the parameters are part of the Report pull-down menu. In 2008 the parameters can be found as an object above the DataSet in the left-hand navigator of the report design window.

    If you have any difficulty, I'll try to help with more specifics.

    Geoff

  • I am using 2008. Thanks for the help. I'll get back to you if i get stuck

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply