Hi

I use the reporting services to generate the report.I use query like
"Select Distinct(ID) from Table1".In that query Its generate the number of ID ,So In report user able to several "ID" at one time,so I think if I can use combo box then user can select ID which they want,but problem is how I do that and I think if I add combo box then its easy,So how I add combo box into my report.

Thank
Tank50

Dani AI

Generated

Short follow-up to the thread: was correct — SSRS supports a multi-select parameter that renders as a drop-down with checkboxes. The practical steps, common pitfalls, and a couple of server-side options are outlined below.

Create a parameter (e.g., ParamIDs) and set its Available Values to a dataset that returns the IDs (value) and an optional label. Enable the parameter's multi-value option (labelled "Allow multiple values" or "Multi-value" in some designers). In the main dataset use an IN clause so the parameter can expand to multiple values, for example:

SELECT * 
FROM dbo.YourTable
WHERE ID IN (@ParamIDs)

Notes and alternatives:

  • When a text command against SQL Server is used, SSRS expands a multi-value parameter into multiple SQL parameters, so IN (@ParamIDs) works with the SQL Server provider. If using a stored procedure, SSRS cannot pass the parameter array directly; one option is to pass a CSV string (use =Join(Parameters!ParamIDs.Value, ",") as the parameter value) and split it server-side (for modern SQL Server versions, STRING_SPLIT works). Another, safer option if available is a table-valued parameter (TVP) on SQL Server 2008+; that requires matching client/provider support.
  • If the parameter shows as a text box instead of a combo, verify that Available Values are set, the parameter data type matches the returned values, and the dataset returns rows.
  • For very large lists, consider a filtered lookup dataset or a separate UI to avoid performance and usability problems. The built-in "(Select All)" option appears automatically when Available Values are provided.

Reference:

Recommended Answers

All 4 Replies

Define it as Parameter.

Hi

Thanks Ramy,but yes I have to use it as a parameter,but there is distinct ID like 1,2,10,20,etc ,So i want to select the several Id at one time,like "1","2","10".So cant I create combo box? ,without create text box to enter ID.

Thanks
Tank50

To allow multiple selection from report parameters check Multi-value

Hi

Thank you Ramy,It works.:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.