Unable to add SSRS Parameters/Filters - reporting-services

I have created a ssrs report which requires a drop down filter to select values.
The steps I have taken in report:
Created the Dataset
SELECT * FROM Voluntary_CCC_Split
Then applied where statement in dataset - where [WORK ORDER OPERATIONS TYPE] in (#WorkOrderOperationType)
The parameters now appears but when changing to available values and selecting dataset, value field and label field i get error below when generating report:
the report parameter has a default value or a valid value that depends on the report parameter. forward dependencies are not valid
I only have one parameter

Your parameter was configured to have its available values populated from a dataset that referenced the same parameter. Instead of this circular reference, create an additional dataset that simply returns the labels and values for the data you need, and use that to populate your parameters available values.

Related

SSRS - multi-value parameter is throwing error when more than one value is selected

I am using Visual Studios 2015 with SSDT installed. I cannot show my query as it has confidential columns in it. Let's just say I have two temporary tables that gather general data which are joined in the select statement and uses a where clause that accepts a multi-value parameter of text datatype (column is char(8)) to filter the information in the report. I have checked allow multiple values in the parameter properties. There are no available values, the user types the values in. (I've also tried supplying values in drop down list with same results).
Where smpl_lvl_cd in (#SampleLevel)
I would think this is quite simple and when the user selects one value, everything works well. As soon as you choose more than one value, you get the error "An expression of non-Boolean type specified in a context where a condition is expected, near ','."
For example: Sample Levels 'Q' and 'V' are selected. The way I understand it, SSRS send 'Q,V' to the query. (Or does it send "Q,V,'?) With this in mind, I've tried using:
Where smpl_lvl_cd in (select value from string_split(#SampeLevel, ','))
with similar results "Procedure or function string_split has too many arguments specified....." followed by the same Boolean message.
This parameter is not being sent to a stored procedure but I've tried using the join function on the parameter in combination with the string_split in the query. I end up getting no data for more than one selection.
Please help.
See this article: SSRS multi-value parameter using a stored procedure. You have to change your multi-valued parameter array into a string before sending into your dataset. therefore send the expression =Join(SampeLevel!Value,",") instead of [#SampeLevel]

Issues with Passing Multi-value Parameters to a Drill through Report

I have two reports were I pass multi-valued parameters to it's underlining data and both reports work very well independently. The parameter strings are being split using the function dbo.UTILfn_Split. When trying to drill from the main or Summary report into the sub or Detailed report all other parameters field in the report are populated except the multivalued parameter field. The parameter lists or value are listed in the detailed report but not selected and therefore cannot run the report even though the detailed report parameter property is set to allow multiple values. In both reports, the where clause is set "IN" not "=." How do I fix this?
In your Summary Report, when you pass the parameter to the sub or detailled report, the passed value parameter should be like this expression:
=join(parameters!yourMultivaluedParameter.Value,",")
after that, you pass the name of the parameter to the corresponding parameter in the dataset Detailled report.
In your SQL (SP), get the multivalues of the parameter by spliting it with your function
like following, depending of the result of your function, for exemple:
INNER JOIN dbo.SplitFunction( #yourMultivaluedParameter,',') tmp on tmp.yourColumn = ...etc...
Hope it helps...

Populate a parameter dropdown based off another parameter

I am trying to populate a dropdown based off another dropdown parameter. I have 5 parameters, but the first 3 populate the 4th in the report. So the 4th and 5th parameter are what the user uses to populate a report. So the 4th parameter (meetings) has a meetings dataset and the 5th parameter is meetingType with a dataset of meetingType. So when the user selects a meeting, then the meetingType gets populated by that selection. Currently both dropdowns produce all results, which I don't want. I just want all results for meetings and then the meetingType gets populated by meeting.
The table it produces once the report is ran doesn't use those properties and there isn't a place to query anything. I can only use available values from each dataset and not use available values based on the selection of the 4th parameter.
I'm not really clear. do you need a parameter or do you just want to have the meeting type available as a value in your report output?
Fairly straightforward. You have two datasets, one for each parameter. You need to filter the second dataset based on the first parameter.
For example, I often create reports that ask for a range of values, let's say programs. Once the user has entered the beginning value, the ending value must be greater than or equal to the beginning value. So, on the ending value dataset I create a filter. In this case, the filter says that the field code (which is my program) must be between the starting parameter and the maximum value allowed:
You can make your filter as complex as needed - referring to the other parameter with a formula
You can also do this via separate datasets for each parameter.
Lets say you have two parameters #param1 and #param2
you want the values on #param2 to change based on #param1 selection.
You will have your main dataset (main_dataset) with a where clause something like this
where sometable.somecolumn = #param1
and sometable.someothercolumn = #param2
Now you create a dataset (param1_dataset) for #param1 which brings back all the values you require for this parameter
Now create another dataset (param2_dataset) form #param2 and add a where clause to it which restricts the returned list.. something like this..
where sometable.somecolumn = #param1
Now on your report parameters.. set the Available Values for each parameter (report parameter properties) to "Get Values from a query" and select the appropriate dataset and the value field and label field (returned by the dataset) for each parameter.
Now when you run your report, your parameter selection 2 should change based on what you selected for parameter selection 1

SSRS Report Parameter Available Values setting

I am trying to set Available Values on SSRS Report Parameter properties.
I wish I can add some images but I do not enough reputation.
When I select 'Get values from a query', I don't have problem.
However, I get this message when I am trying to use 'Specify values'
"Field cannot be used in report parameter expressions."
I am using following expression. Any help would be appreciated.
=First(Fields!EventCode1.Value, "History2")
You cannot use the same dataset "History2" as a field (column in report design) and as well as in parameter list. Create a different dataset with the required value and use that in parameter.

ssrs - Forward pointing dependencies are not valid

In an existing SSRS 2008 r2, report, I am attempting to add a parameter called 'Customer_Category'. I am getting the following error message:
The report paramter 'CustomerNumber' has a DefaultValue or a ValidVaue that depends on the report parameter 'Customer_Category'. Forward pointing dependencies are not valid.
I am trying to determine how to fix this error. The 'CustomerNumber' is a parameter value that is obtained by reading from a dataset. In this dataset there are existing other parameters called 'Customer_Type' and 'Customer_Preference'. Both of these parameters obtain there values from selections that the user makes when the SSRS report is executing. There are no default values.
I am trying to have the 'Customer_Category' be the same way where there are no default values and the user must select the parameter value when the report is executing. There should only be one value that the user can select from.
The new parameter called 'Customer_Category' is the last parameter in the list of parameters. Does the order of parameters make a difference? If so, how can I move the 'Customer_Category' parameter in front of the customer_number parameter?
Here is the sql that is used from obtaining a list of customers from the dataset for customer_number:-
SELECT Distinct CustomerNumber
FROM BridgeUserCustomer
WHERE
Type = #Customer_Type
AND Preference = #Customer_Preference
AND Category = #Customer_Category
GROUP BY CustomerNumber
Would you tell me what is wrong and what I can do to solve the problem?
Summary
The order of parameters in your IDE (Report Designer or Report Builder) matters.
If you have a hierarchy of parameters (one level dependent on the other), the top-level parameter must appear first in the parameter list.
In SSRS these are referred to as cascading parameters.
Solution
Open the Report Data tab
Expand the Parameters folder
Select a parameter and use the up/down arrows to adjust order
Report Designer
Report Builder