Search code examples
sqlreporting-servicesreportbuildermicrosoft-reporting

Report Builder - 3 Parameters all in one Query. Forward dependencies are not valid


I have an issue with building my report, I have 3 params and all 3 are in a query, they are supposed to get their values from the "drop down menus" before running the reports and are used in a where cluase to get specific stuff from the database. However I can seem to get it to work.

Example Query

Select * from [Table]
Where ID = @ID and DateFrom = @DateFrom and DateTo = @DateTo
order by ID

This is the query, I tried changing the orders of the params but it doesnt work.

Error: The report parameter 'ID' has a DefaultValue or a ValidValue that depends on the report parameter "ID". Forward dependencies are not valid.


Solution

  • Based on the error you reported...

    "Error: The report parameter 'ID' has a DefaultValue or a ValidValue that depends on the report parameter "ID". Forward dependencies are not valid."

    I suspect your ID parameter's valid values are taken from a dataset query. The dataset query uses a parameter called @ID . You cannot populate values for a parameter if the parameter you are trying to populate is required by the query.

    If you are trying to get a list of available ID's to populate the ID parameter drop down then you need to create a separate dataset for this. The dataset query would be something simple like.

    SELECT DISTINCT ID FROM [Table] ORDER BY ID
    

    You can then change your ID parameter's "Available Values" dataset to point to this new dataset.

    If this does not help, show you report design (the parameters at least), the parameters properties and the dataset queries for each one. Your issue should be clear once all that is visible.