SSRS report multi select parameter does not select values automatically - reporting-services

In SSRS report I have 2 parameters ClassName and StudentName both are allow to select multiple values. StudentName parameter react according to ClassName parameter's value. Both parameters have default values. when I run the report default value selected in ClassName dropdown and as per ClassName value StudentName values selected by default in StudentName dropdown as per below image.
Now, When I select more than one values from ClassName as per below image I can retrieve correct student names in StudentName dropdown but values are not selected by default.
Expected result should be as below:
is this SSRS limitation? or is there any work around?

Modified StudentName dataset as below:
SELECT S.StudentName + '_' + CAST(ROW_NUMBER() OVER (ORDER BY S.StudentName ASC) AS VARCHAR(50)) AS studentname1,
S.StudentName
FROM
(SELECT StudentName FROM Table_3 WHERE ClassName IN ( #ClassName )) S;
And modified Value field to studentname1 for #StudentName parameter in available values and default values.

Solution to this issue is to change the default options(student name) every time and in some way dependent on changed parameter(className).
Like in your report student names are default options and remains same(Smith or Jack) for any class input and new options not getting select.
earlier my values were Student1 result on first change of date
later I add date to me student like Student1_2124 (2124 is Julian Date and dependes on Date parameter) It will change the Student everytime so result is all selected values new all selected parameter
all options would be selected only if you can make student name like Jack_className and use only before underscore to print in report.
It worked for me.

Related

one parameter value dependant on another parameter in report

I have 2 report parameters as customerNumber and customerName. The user must enter one or the other - Not both, so text entered on the
first one will disabled the second parameter and vice versa.
Can this be done using dataset or how to link both so as only 1 of them accept values?
Many thanks
I don't 'think' you will be able to do this.
You can simulate one being disabled based on the other but you will only be able to do that one way I think otherwise you would have a circular reference.
Imagine your customerName dataset looked something like
IF #customerNumber IS NULL
BEGIN
SELECT '' as customerName
END
ELSE
BEGIN
SELECT DSITINCT customerName from myTable
END
This would be OK, but you could not then do the same to the customerNumber parameter's dataset as it would have to reference the customerNumber parameter, and round we go again.
Other option?
Assuming you want the user to supply a name or number but not both, you could use a single field for name/number entry and then a list based on that that contains the actual value you want.
So the first parameter customerSearch is plain text single value.
The dataset for the second parameter 'customerNumber` available values might look like this
SELECT customerName, customerID
FROM myTable t
WHERE customerName LIKE '%' + #customerSearch + '%'
OR customerID = #customerSearch -- CAST the parameter if required
Set the parameter to multi-value and optionally set the default values to the same dataset.
Not ideal but maybe a reasonable compromise.

SSRS cascading parameter needs a value, even though the parent field has other values

I have an ssrs report, in which the user can choose the type of the chart he needs(pie,line,.., table).if the user chooses "table", another parameter must be chosen (#ListOfColumns). if I choose "table", I can see the list of fields and generate the report. When I choose another type of chart, the list of fields is empty(as it should be),but cannot generate the report due to "#ListOfColumns" parameter needs a value.I tried to set this parameter to blank and null, but didn't work. before adding "table" and cascading parameter, everything was working fine.
detail:
#ChooseChartType parameter is integer, with "specify values":1,2,3,4(4 is table).
#ListOfColumns dataset is:
if(#ChooseChartType=4)
SELECT 1 ID, 'TypeOfTest' AS ColumnName UNION
SELECT 2 ID, 'NoOfTest' AS ColumnName UNION
SELECT 3 ID, 'Priority' AS ColumnName UNION
SELECT 4 ID, 'Purpose' AS ColumnName UNION
SELECT 5 ID, 'TypeOfRoute' AS ColumnName UNION
SELECT 6 ID, 'CreatedBy' AS ColumnName
Add IF conditions to your dataset then just remove #ListOfColumns from your dataset script if it's not needed.

To show more than one value to single drop down - SSRS 2008 R2

I have a question regarding to show more than one value to drop down but use only one value as a parameter
My query
select custcode, custname from customertable
in return i will have two columns.. at SSRS i want a single dropdown which will show me these two data, but once user select a value, it should pass only customer code to parameter, how to do that with SSRS
Parameters have two properties that are important - the Value and the Label. The Value is used as the parameter value in things like SQL expressions; the Label is what is displayed in the parameter selection box.
So we need to have two fields returned by our parameter lookup query in Available Values: the custcode which is used as the Value field and the concatenation of custcode and custname for the Label field.
select custcode, custcode + ' - ' + custname as Label
from custmertable

SSAS (MDX) - Filtering Dataset based on another Dataset

I have a mdx report on a cube. As available values for division number report parameter I have an autogenerated dataset (dataset1, with all divisions in company) which query looks like this:
WITH MEMBER [Measures].[ParameterCaption] AS
[Dim Division].[Hierarchy].CURRENTMEMBER.MEMBER_CAPTION
MEMBER [Measures].[ParameterValue] AS
[Dim Division].[Hierarchy].CURRENTMEMBER.UNIQUENAME
MEMBER [Measures].[ParameterLevel] AS
[Dim Division].[Hierarchy].CURRENTMEMBER.LEVEL.ORDINAL
SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]}
ON COLUMNS ,
[Dim Division].[Hierarchy].ALLMEMBERS
ON ROWS
FROM ( SELECT ( STRTOMEMBER(#FromDimDateHierarchy, CONSTRAINED) : STRTOMEMBER(#ToDimDateHierarchy, CONSTRAINED) )
ON COLUMNS
FROM [ArveCubeBiceps]
)
I have another dataset (dataset2), which consists of only those division numbers, which logged in user is supposed to be able to view (data supplied by a procedure). I need to filter dataset1 available values by the values of dataset2.
-I can't just use the dataset2 as available values for division number, since report query is MDX, and expects tuples, which dataset2 doesn't provide. When I try to concatenate dataset2 values into tuples, I get an error that I can`t use "&" for Object() type.
-When I create a hidden parameter on report, which available and default values are those from dataset2, and then apply a filter expression to dataset1 query, which says "DivisionID in #hidden_parameter" - I get no available values for the Division parameter ( I checked the tables, all data is there )
What do I have to do to get this filter expression working... please help anyone :)
#mmarie
second dataset is created by stored procedure:
USE [Biceps]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[ArveDivisionsByUserID]
#ldapuid nvarchar(30)
AS
BEGIN
declare #hier as hierarchyid
declare #managerID as int
select #managerID = em.employeeID from Dim_Employee2 em where em.ldapuid = #ldapuid
select #hier = dv.hier from Dim_Division dv where dv.managerID = #managerID and hier is not null order by hier desc
select divisionID from Dim_Division dv where hier.IsDescendantOf(#hier)=1 order by hier
END
#FrankPI - offtopic
don't know why, but I used ctrl+k for code, but it`s still regular text :(
If you can change the second query, then this could return the list of allowed members as a set definition string instead of a list of members, using e. g. the SetToStr function. This could then be used in the first query as a parameter replacing the text [Dim Division].[Hierarchy].ALLMEMBERS for the rows by StrToSet(#AllowedDivisionSet, CONSTRAINED).
If the result sets are not huge, the easy way is to do this is with a filter on the Dataset and NOT in MDX:
Add a Boolean filter in which the Expression is =True and the Value is something like this:
=iif(instr(join(Parameters!DataSet2Parameter.Value,","),
Fields!ToDimDateHierarchy.Value)=0,True, False)

How do i reference the value of a control in a rowsource query?

Im trying to write a query that will pull the value of the selected item in a combobox to use in a WHERE clause.
For example, the user selects "Jeff" out the combobox that is named cboNames. The bound value is 1 (the primary key). I'm trying to create the query:
select * from tbleEmployees where empID = cboNames.Value
obviously this doesn't work. Get what I'm trying to do?
How do i place the control value into the query??
select * from tbleEmployees where empID = [Forms]![YourForm]![cboNames]