Any way to pass Multiple Values for a single Label in the Parameter? for specify values

iskala venkat 1 Reputation point
2021-11-08T06:15:03.057+00:00

I have a Report that Contains 2 Parameters, @Customer & @Zack . When trying to set up the Available Values for @Zack , I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610"

One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is set up as a filter on the Tablix referencing the @Zack parameter.
PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data.

Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610.

147282-image.png

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,806 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Joyzhao-MSFT 15,566 Reputation points
    2021-11-08T08:25:24.37+00:00

    Hi @iskala venkat ,
    Your issue seems to be similar to the one in this link:https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ef341204-0591-4383-b407-dffd8996405e/any-way-to-pass-multiple-values-for-a-single-label-in-the-parameter?forum=sqlreportingservices

    In your case, when there are two values in one of your Labels: "0, 1". If your parameter is setup as above you will quote it in the where clause of the dataset query like so:

    WHERE Column1 IN (@Area)  
    

    From the dataset properties, go to the parameters tab, click expression editor next to the value column for your parameter and set it to:

    =Split(Parameters!Area.Value,",")  
    

    This will take the raw value from your parameter and convert it to an array, just like a multivalue parameter passes for its values. So the WHERE clause will cause the dataset to return data where Column1 is either “0”, or “1”.
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Joyzhao-MSFT 15,566 Reputation points
    2021-11-12T08:33:14.493+00:00

    Hi @iskala venkat ,
    Has your issue been resolved?
    The above method is very effective in my test.
    I have a table like this.

    148729-00.jpg
    I added query parameters using the WHERE clause in the dataset.

    148768-03.jpg

    After running the query, a parameter named "Agent_Code" is created.

    148799-04.jpg

    Set Parameter Properties-Available Values-Specify values.

    148730-07.jpg

    Set the Dataset Properties-Parameters option-the setting expression is as follows:

    148831-06.jpg

    Preview:
    148841-preview.jpg

    If you have any questions, please feel free to let me know.
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments