Auto select cascading multi-valued parameters in VS Reporting Services - reporting-services

I have a couple of multi-valued parameters in my report created using visual studio reporting services, one filtered against the other.
I want that each time there is any change in my first parameter drop-down list, the values appended in my second parameter drop-down list, when updated, must be auto selected by default.
As of now, I get the desired values in my second parameter drop-down list each time there is any change in my first parameter list. However,in some cases,the appended values in my second parameter list are not selected by default.
Please give suggestions to implement this functionality.

By design, it is not possible for SSRS to re-evaluate the default value(s) for a subsequent parameter unless the selected value is no longer in the valid values list, as can be seen from this issue on Microsoft Connect.
One possible workaround is to ensure that when the higher level parameter's selected value is changed, the selected value is no longer available in the valid values list for the dependant parameter - this technique is discussed in more detail here.

Related

SSRS Create As Many Tables As Needed (Using One Dataset) Based on a DataSet Field

I have a query that returns relevant data about inspectors and how long it takes them to respond to issues. The only parameters are a BeginDate and EndDate so for any given date range there could be anywhere from 0 to 100 inspectors.
I am using only one dataset and it contains an "Inspector" field that I'm hoping can be used as a filter to create as many tables as there are inspectors.
I know you can set filters on tables but from my (limited) SSRS knowledge, you must already have the tables created and the filters are typically hard-coded. What I need, is some way for the report to see how many Inspectors there are in the dataset and group those records into their own tables, repeating the same one created tablix over and over as needed.
This is being done strictly in SSRS 2012, not using a ReportViewer where back-end code could help me out unfortunately...
I don't have any code examples to provide, like I said I know you can do filtering but I am at a loss when it comes to doing something like this dynamically based on data... Sorry.
Depending on the report design you could either...
Single report with grouping
1. Create a single tablix.
2. Create a row group by Inspector and then add whatever fields you need to the details section.
3. You can optionally set page breaks between instances of your Inspector rowgroup from the rowgroup properties.
Sub report method
1. Create a subreport that accepts a parameter (InspectorID for example).
2. In the subreport filter the dataset using the parameter passed in so it only return data for a single inspector.
3. Add whatever controls you need to the report to handle a single Inspector
4. Create a main report
5. Add a dataset that gives you a simple distinct list of Inspectors, this will be used to pass parameters to the subreport.
Lets assume it just contains a list of InspectorIDs.
6. Add a list control to the report and set it's dataset property to the dataset that contains your list of InspectorIDs
7. Right-click in the list control's 'cell' and insert a subreport.
8. Set the subreport property to the subreport you created earlier and set that parmameter IsnpectorID to your InpsectorID field.
This will produce a subreport for each instance of inspector it finds.
Sorry about the format of this answer, in a rush!

Updating SSRS Report Breaks Subscriptions with Dependent Parameters

I have an SSRS report that requires several parameters that cascade from each other. So Dropdown list B is generated when dropdown list A value is chosen. When new values come into the report it breaks an existing user's subscription's when the report causes new values to populate in one of the dropdowns. The user is subscribed with pre-chosen values they want. How can I fix this?
This error is pretty self-explanatory. Look at the Default Values for the parameter it's referring to. You either:
A. Specified the wrong data-type.
OR
B. You specified a value that wasn't in the Available Values tab. (most likely)

Display selected values of multi-value parameter in tablix rows

I am designing a report for SSRS. I want the user requesting the report to be able to specify, when they generate the report, from a pre-defined selection some values which should be displayed in a tablix on the report.
I have therefore created a multi-value parameter and populated the Available Values with the options I want the user to be able to select from, and, as expected, when the report is generated the user is able to select one or more of these values.
However, what I now want to do is include a tablix in the report, and display a row for every value in the multi-value parameter that the user selected, with the value displayed in the first cell of the row.
If the values were coming from a data table this would obviously be easy. I've also found answers on how to show all of the selected parameter values in a single textbox using the JOIN function, but I don't want to do that.
The only solution I can think of is to replicate the list of available values in the multi-value parameter in a tablix manually, and link the visibility of each row of the tablix to the selected state of the corresponding value in the multi-value parameter, but that's not very elegant and increases the effort involved in maintaining the report definition.
Any ideas on how to do this? I know the selected values from the parameter simply form an array, but I can't see how to bind a tablix to any data that isn't in a dataset, or how to create a dataset from the parameter values.
Considering that a tablix sources from a dataset, I did some experiments to see how to create a low maintenance solution for you.
Option 1: Create a data set with hard-coded options to match your multi-value parameter and select those options WHERE they exist in the parameter.
Example:
SELECT val
FROM (
SELECT 'opt1' as val
UNION SELECT 'opt2'
UNION SELECT 'opt3'
UNION SELECT 'opt4') a
WHERE val IN (#Param)
Thoughts: easier to maintain than visibility on a table, but still two hard-coded places within the report.
Option 2: Create a dataset that selects the multi-value parameter and splits it by each value. This was my first idea, but I ran into some issues with determining how to actually select the multi-value without a syntax error. I came up with a method that creates a deliminated string in the report and than parsed that string back into rows in the dataset:
Step 1) Within the dataset properties, on the parameter tab, join the multiple values together with a JOIN expression
Step 2) Create a simple query which uses the new SQL Server 2016 function string_split. Note that your database compatibility level MUST be 130 or higher to use this function (SQL 2016+). If this isn't your scenario, there are many string split functions that you can find on Stack Overflow to achieve the same thing.
Fun problem!

Is there any way to hide SSRS report paramteres using expressions?

I have created one report in SSRS-2012. I need to show/hide(not inactive) one parameter based on one formula. Is it possible. I am using Visual studio 2010 for my front-end development and report viewer control for showing the report.
Help me please
Currently there is no way to dinamically hide parameters in SSRS. Depending on your requeriments you may have two ways to handle this issue.
Create one subreport for all parameters and another subreport that does not include the parameter you want to hide, then show dinamically the subreport to the user based on your expression.
Other option is have another parameter set as internal. And conditionally populate that parameter based on your expression. If your condition yields true, populate the parameter with the user selection, otherwise use a default value or populate it to null. At presentation level your parameter keeps appearing but the user selection will take effect only based on your expression.
I think the second option is easier, let me know if you need further help.

Storing multiple parameter values in another parameter in SSRS

I am trying to develop a report in SQL Server Reporting Services using parameters.
I have created a searchable parameter (as described in the link below) which is working as it should. I want to expand the functionality so that I can make multiple searches before viewing my report.
My problem is that when I have searched and selected a value and seach for another value the selected is reset (this is because the parameter where I select is cascading to the one where I search). Is there any way I can 'save' my selected parameter so that I, in the end, have all the seached and selected values which I then can filter on?
Searchable parameter: http://romiller.com/2008/07/29/searchable-dependant-parameters-in-ssrs/
(My problem is the same as Peter Schmidts comment in the link above.)
Thanks
The only way I can think of to get the results you desire is to create separate dataset with a required parameter that depends on a search term from the other parameters...this is very hackish and requires a search on multiple values stored procedure. This would cause the report to postback after you select your search criteria then display another parameter dropdown after a second refresh where the user could select the desired id based on search terms and then finally clicking the "view report" button a second time.