SSRS cascading parameters and multiple results - reporting-services

I have an SSRS report that uses cascading parameters, the second parameter is using a dataset against the results of the first.
If the first is set to N or Y, the second then is the same.
If the first is set to None, I'd like for the second to then be able Y or N on it's own, to have a subset of grouping.
The first parameter sets several others to Y to create a grouping level, and the second one only has <Select a value> if the first is set to None.

Related

How to add previous parameter and the current parameter in a SSRS parameter

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.

How to populate a Tablix referencing data from another Tablix dataset?

I have two Tablix: Tablix A and Tablix B:
Each Tablix is connected to different datasets as illustrated in the image below:
How do I populate Tablix B by looking up data in Tablix A?
For example: Tablix A contains Vehicle models but I also need to populate Tablix B with Vehicle colors using the VehicleID in both dataset.
Using a Lookup Function, this only works if both datasets are references in the same tablix, how do I do this using separate tablix?
Attempting to use separate tablix, I get the below error:
[rsFieldReference] The Value expression for the text box
‘Textbox57’ refers to the field ‘VehicleColor’.
Report item expressions can only refer to fields within the current dataset scope or,
if inside an aggregate, the specified dataset scope.
Letters in the names of fields must use the correct case.
Illustration:
You can use "lookup" to get a single value from another dataset. For example:
=Lookup(Fields!VehicleID.Value, Fields!VehicleID.Value, Fields!VehicleColour.Value, "Vehicles")
would bring out a single (the first in the dataset) VehicleColour where the IDs matched. If there is only a single match of ID between the two datasets, then the correct colour would be returned.
=LookupSet(Fields!VehicleID.Value, Fields!VehicleID.Value, Fields!VehicleColour.Value, "Vehicles")
brings out an array, which can only be displayed in a textbox if it's converted into a string using join:
=join(LookupSet(Fields!VehicleID.Value, Fields!VehicleID.Value, Fields!VehicleColour.Value, "Vehicles"), ", ")
which will bring out a comma separated list of all VehicleColours where the IDs match.
For more information on Lookup, see: https://msdn.microsoft.com/en-GB/library/ee210531.aspx
For more information on Lookupset, see: https://msdn.microsoft.com/en-us/library/ee240819.aspx

SSRS: How to use same dimension & hierarchy for 2 parameters

So, I'm stuck on how to resolve this issue.
I would like to use the same Dimension & Hierarchy two times.
The dimension and Hierachy is already used one time to exclude a column value.
Now I would like to add a parameter to the same hierachy/dimension (with acfource the earlier rule applied)
And I can't get my head around to solve this.
If I'm understanding your issue correctly, then the solution is fairly simple. For each parameter that requires a dropdown list you need a different dataset in your report. For the first parameter (#p1), set available values and labels based on the result of a query.
In the dataset for the second parameter (#p2) which should have a filtered dropdown, have a second dataset that will be used to set the available values and labels of the second parameter. In this dataset, you want to reference the value of #p1 somewhere in your query. Upon opening, the report will generate the results of the first dataset to populate the first parameter's dropdown list. Once a value has been selected for #p1, the report will generate the second dataset to populate the options for the #p2 dropdown list. In this way, you can dynamically filter the options available to the dropdown list for the second parameter.

Applying different Visibility to each Tablix

I have a report showing hours and dollars that are written off. Jobs for this report are classified as NRB (non-billable) and non-NRB (billable). Each job type has its own Tablix in the report and I want to populate each Tablix based on a bit value - IsNRB.
All of the "0" IsNRB rows should populate the top Tablix and the "1" values should populate the bottom Tablix . For the most part this is working. What is happening, however, is that some Programs or Clients will have both NRB and non-NRB jobs, and it appears that as each Tablix works its way through the rows of the report dataset, it will capture and retain the first value for IsNRB and apply that to the entire report.
I have tried logic similar to the following in a number of places/ways:
=IIF(Fields!IsNRB.Value = False, Fields!CustProgram.Value, NOTHING)
The Grouping hierarchy of the report looks like this:
ProgramGroup
ClientGroup
Job/SubJobGroup
Detail is here
I have tried setting evaluative expressions similar to the one above on TablixVisibility, GroupVisibility, RowVisibility, and in the field expression itself. The behavior seems consistent in that the first row for that Program, Client, or Job sets the value of IsNRB for the entire report.
As a concrete example, the first Program, "Cascadia" has three rows where IsNRB = 1/True and two where IsNRB = 0/False, and the latter two rows of data are always misapplied because the value of 1/True is overriding the 0/False valued rows.
What is the proper approach to take that will allow the first Tablix to accept and display rows of data where IsNRB = 0 and the second Tablix to show those with a value of 1? Do I need to abandon the IsNRB bit datatype and just have a distinct dataset for each Tablix? That seems like a klunky way to approach the report.
Filter each table on the IsNRB field. Right click the tablix and select Tablix Properties. Select filter, then then select the field you want to filter against (IsNRB) and the value your want it to be (1).
This will put all records with a 1 for the field in one table, and with a 0 in the other

Show all records/some records based on parameter value

I have stored procedure which returns around 100 rows. One column is Category.
In SSRS, I've created DataSet related to that stored procedure. On Report body I have Tablix, which I relate to DataSet.
Now, I have additional parameter, called FilterColumn, which consist all different categories from dataset, plus one row called "All products".
How to filter tablix based on that parameter to show me whether products from specific categories or all products?
You need to set up a filter similar to the following:
Where the expression is:
=IIf(Parameters!FilterColumn.Value = Fields!Category.Value
or Parameters!FilterColumn.Value = "All products"
, "Include"
, "Exclude")
This matches the row Category based on the parameter value, or, if the value = All products, will include all rows.
As mentioned in the comments and the other answer, this is possible in the SP too, but since it seems to be specifically to demonstrate the functionality this should do the trick at the report level.
I have created some solution and worked for me:
In Expression field, I put first expression:
1. Iif(Parameters!FilterColumn.Value = "All", 1, Fields!Category.Value)
In Value field, I put second expression:
2. Iif(Parameters!FilterColumn.Value = "All", 1, Parameters!FilterColumn.Value)
So, when I choose "All" value in parameter, then first expression will result 1, and second expression will result 1, and i have 1 = 1 which is true for all rows, and I got all rows in table.
When I choose specific category from parameter, then in first expression result will be Fields!Category.Value and in second expression will be Parameters!FilterColumn.Value. Simple, I got Fields!Category.Value = Parameters!FilterColumn.Value, or just give me rows where category is that choosen in parameter.
Pass the Additional Parameter to your store procedure, so you send data that is already sorted to your report. This will avoid multiple Tablix created depending on your parameter selection.