Brice
Brice

Reputation: 21

In SSRS, how can input multiple data into text box?

I'm trying to construct a report in SSRS and I would like to know if instead of using a multiple selection drop down box to search for a particular set of serial numbers, I can give users the ability to manually enter multiple serial numbers of their choice into a text box.

The list of serial numbers in the particular data set is quite large, so with a drop down user would be scrolling through thousands of serial numbers, as opposed to just typing in serial numbers of interest.

Upvotes: 1

Views: 2611

Answers (1)

P.Salmon
P.Salmon

Reputation: 17615

You can do this using a parameter

  1. Add Parameter
  2. In the general properties amend the data type and check Allow Multiple values
  3. Click OK
  4. Right click on your data set query
  5. Left click DataSet Properties
  6. Left click Parameters
  7. Add the parameter you created in 1 above - preceded by @
  8. Click on fx
  9. in the expression dialog key =SPLIT(JOIN(Parameters!.Value,","),",")
  10. Click OK
  11. Click OK
  12. Amend your dataset query to include where something in(@)
  13. Save the amended query
  14. Preview the report
  15. A parameter box will appear
  16. Click on the drop down
  17. Enter a comma separated list of serial numbers
  18. Click on view report

Using adventureworks added a parameter @soid The split statement is

=SPLIT(JOIN(Parameters!SOID.Value,","),",")

The dataset query is

SELECT SalesOrderID, RevisionNumber, OrderDate, DueDate, ShipDate, Status,  n                                OnlineOrderFlag, SalesOrderNumber, PurchaseOrderNumber, AccountNumber,      CustomerID, SalesPersonID, TerritoryID, BillToAddressID,                             ShipToAddressID, ShipMethodID, CreditCardID, CreditCardApprovalCode,  CurrencyRateID, SubTotal, TaxAmt, Freight, TotalDue, Comment, rowguid,  ModifiedDate
FROM Sales.SalesOrderHeader WHERE   SalesOrderID in (@SOID)

Upvotes: 2

Related Questions