I have two parameters in the SSRS report(Company and Department).'Department' Parameter is dependent on the value you select from Company.
For Example, Company :A --> Department:x or Department:y (Company A has 2 department x and y)
I am trying to append the parameters in the Report URL by using &rp:Company=A this works fine.
But when i try to append the Second Parameter &rp:Company=A&Department=x in the URL it does not pick the second parameter value ,i.e. it selects Company as 'A' but unable to select the Department as 'x'.
what would be a correct way to append second parameter?
I have tried using &rs:Command=Render&Company=A&Department=x but this does not work.
Related
I have 3 parameters for my SSRS report. My first parameter is for search the data that will be shows on. The second parameter and the third parameter is for save the second parameter selected value. I already tried to use Join to join the previous selected value and current selected value, but on my third parameter it keep replacing with the new one. And the previous parameter will be disappear.
How can I add the previous and the current parameter like this function += on integer when we want to add the previous number and the current number in looping instead replacing it.
You can use something like that for your 3 parameter:
= Join(Parameters!Parameter2.Value, Parameters!Parameter3.Value, ";")
But you have to handle Null values for parameter 3 and 2. Also I dont think it makes sense to save the paramter like this. For example what happens when the user selects value A, B, C for parameter 2 and afterwards he selects B, E. Now you have B twice.
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
I have three related three dataset like these
I need to display "INVOICE_CODE" from DatasetA concatenate with "COUNTRY_NAME" from DatasetC Example :
"INV123-Korea"
I tried to use "Lookup" function by this step
1.) First table is used for main table in a report.
So I will assign DatasetA to my tablix1
2.) At Tablix1, rigth click on a cell and create expression via
3.) Put this concept code. (A--->B--->C)
=Lookup(A.FK,B.PK, Lookup(C.FK,B.PK,C.ANS,"Dataset C") , "Dataset C")
But It's not work.
In this case using Lookup function is not my first preference but if you want to accomplish using lookup you can do something like this.
=Lookup(
Lookup(Fields!Customer_Code.Value,
Fields!Customer_Code.Value,
Fields!Country_Code.Value,
"Dataset B"),
Fields!Country_Code.Value,
Fields!Country_Name.Value,
"Dataset C")
Note: SSRS is case sensitive so make sure you are using correct casing for your fields and Dataset names.
Lookup function returns only the matching value for the dataset you referenced. There is another SSRS function LookupSet which can be used to return the set of matching values based on name/value pair.
First lookup you get Country_Code from DataSet B by supplying the customer_Code value from the Dataset A.
Second Lookup function will use the result of first lookup function to get the Country_Name from the DataSet C.
To show both Invoice from Dataset A and Country_Code from DataSet C. Create two placeholders. In the first placeholder directly put =Fields!Invoice.Value and in the second place holder ut the above lookup expression.
Here is an example of what my tablix/matrix looks like and some examples of what should happen. I have the parameters in the second report setup to accept values and in the main report I have just selected the field it should pass. Since it’s a matrix and grouped, I would think if you clicked a sub total row it would know what values relate to that row.
Following examples,which define what should happen:
1.When i click on cell B3(USA) it will pass Locations name i.e USA and Customer name i.e ABC as a parameter to sub report.
2).When i click on cell B5 i.e Sub total, it will send both locations i.e. USA,Dubai and customer name i.e.abc as a parameter to Sub Report.
3).When i click on cell B10 i.e Grand Total, it will send all Customer names with there respective locations as a parameters to the sub report.
Thank You
This is how I would do it. For the Subtotal link, pass "ALL" for the Location Parameter and =Fields!.Customer.Value for the Customer Parameter. For the Grand Total link, pass "ALL" for both Parameters. Then update your Sub-Report Query Where clause:
Where
(Customer = #Customer or #Customer = 'ALL')
and (Location = #Location or #Location = 'ALL')
This will return all Customer/Location records when the respective Parameters are set to 'ALL'.
Let me know if you need any more detail.
I don't think you can achieve exactly what you want for your examples 2 and 3 using SSRS alone.
I would derive new columns in the Dataset to hold the concatenated parameter strings you want to pass. For your example 2, this column might be called Customer_Locations and hold a value of "USA|Dubai". I would pass that value to a multi-valued parameter in the sub report, using the SSRS Split function in the Subreport Parameter definition. Its important that the chosen delimiter doesn't appear in the possible Location values.
The same value would repeat in each row of the Dataset, for all the rows for that Customer.
For example 3, I would add 2 further columns e.g. Customer_Locations_Grand_Total = "USA|Dubai" and Customers_Grand_Total = "ABC|CDE". These same values would repeat for all rows.
I will try to explain the issue as best as I can by oversimplifying the report structure. Report one contains 1 group called ResourceCenter and then one line of totals under it. The totals are actually a group but the grouping is done in SQL and are presented in a detail group. The report looks something like this:
Report 1
ResourceCenter 1
Total1 11
Total2 4
Total3 8
ResourceCenter2
Total1 12
Total2 11
Total3 6
From this report, I need to drill through to another report that has a bunch of multi-valued parameters. For the drillthrough, I am able to use single values for everything except for EmployeeNumber. For that, I need to be able to pass a list of EmployeeNumbers to the multi-valued parameter in Report 2. The EmployeeNumbers are not currently present in any DataSet or parameter in Report 1 but are based on ResourceCenter. So, if the user has run Report 1 and clicks on ResourceCenter 1, I need to be able to pass a list of EmployeeNumbers associated with ResourceCenter 1 to the multi-valued parameter in Report 2 in a way that Report 2 will handle it correctly.
NOTE: I should add that I have created two SQL functions that accept an input of ResourceCenter and then return a list of employees. One is a table-valued function that returns a single column of EmployeeNumbers. The other is a scalar-valued function that returns the EmployeeNumbers as comma-separated values. I then have some custom code that runs the SQL function in the background and returns the list. I have not had any success with returning a dataset that SSRS can use but I have been able to get the scalar-valued function to 'work' in the sense that I can create a field on a dummy report and see the output. I have not had any luck getting Report 2 to accept a comma-separated list, though.
This person was doing a drill-through and appears to have solved a similar problem with a multi-value parameter. In that case it had to be formatted for an IN clause.
=SPLIT(JOIN(Parameters!SomeParameterName.Value,","),",")
If Report2 won't take it in this format, you might have to add a separate single-valued parameter that will accept a comma-separated string, which you then have to parse.
I'm using SSRS 2016, and my datasets are based on stored procedures, but passing multi-value parameters to a drill down doesn't seem to be an issue anymore. By default, when you select a multi-value parameter it gives you something like Parameters!ParName(0).Value which would pass just the first value. But if you remove the (0) and just leave it as Parameters!ParName.Value, it seems to be passing all values fine.