简体   繁体   中英

How to create a dropdown filter list in SSRS?

I would like to create a drop down filter list based on Region column in my table. I create a parameter by query like this:

在此处输入图像描述

I set up parameter to get the values from region column.

在此处输入图像描述

However, I got the error like this:

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

The definition of the report '' is invalid.

An error occurred during local report processing.

You need to create a second dataset in your report to provide the list of regions to the drop-down list, for example:

SELECT DISTINCT [region]
FROM [table]
ORDER BY [region];

In the available values for the parameter, set the Dataset to this new dataset, & the Value & Label fields to the [region] column.

See this tutorial for more info: https://learn.microsoft.com/en-us/sql/reporting-services/tutorial-add-a-parameter-to-your-report-report-builder?view=sql-server-ver15#AddDataset

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM