Question

One of the parameters I have in my SSRS Report is called Customers. The user wants to be able to select multiple customers from a drop down list. Our customer list is over 500+ entries long. How can I get that many values in a drop down list. For that matter, how many values will a parameter handle? Is there a way to set the drop down list to be able to be typed over to prompt values? An example of that last question would be like how on most forms that ask for the state you live in, you can click on the list and type "TX" and it will move down to Texas instead of having to scroll down. I hope that makes sense. Thanks for all your help in advance!

Was it helpful?

Solution

You cannot have the parameter's field to behave with Autocomplete text. And I agree that having 500 values in small field is not user friendly.

My suggestion is to split the parameters into 2-4 different parameters (in order to make the customer search more easy), each parameter will have the customers name according to the ABC (for instance the first params will contains the customer names from A-I,second J-R,last S-Z)

If so, your query should look like the following:

SELECT customerName,customerAddress,customerCity,...
FROM customerTable
WHERE (customerID IN (@customerParam1) OR customerID IN (@customerParam2) customerID IN (@customerParam3))

OTHER TIPS

I don't know the how to do the second part with typing in a value but I can help with how to setup the drop down list. First write a query that selects the customer name and unique value for the customer.

Example:

SELECT CUSTOMER_NAME, CUSTOMER_ID
FROM CUSTOMER_TABLE

Then add the parameter and select your data type and the check box that says "Allow multiple values". Then in the properties click the "Available Values" tab. Once that opens select "Get values from a query" and select the the query you just wrote. Once that is selected go to the "Value" field and select the unique value from your query and for the "label" field select the customer name and they should all show up.

When using the values from the parameter in your main query you will need to make sure you use the IN function and not =. This is because you are not getting just one value back but all of them at once.

Example:

SELECT CUSTOMER_NAME,CUSTOMER_ADDRESS,CUSTOMER_CITY,...
FROM CUSTOMER_TABLE
WHERE CUSTOMER_ID IN (@CUSTOMERNAMEPARAMETER)

The name of the parameter is what variable name you need to use.

Also just another tip you can have them all default to selected by going to the default values and select "Get values from a query" and select your query and unique value again.

Also I don't think there is an issue with a number of items limit on the list box. I've had it up to almost 1,000 and had no issues.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top