I'm looking to group the options of a multivalue parameter. What i need is an option to display parameters like this and when 'Team 1' is checked, all three options(Davis, Arun, Scott) needs to be checked and being able to check 'Cary' alone without 'Mary' or 'Team 2' being checked. Is this kind of grouping possible using SSRS?
Select All
Team 1
Davis
Arun
Scott
Team 2
Mary
Cary
What you need to do is have cascading parameter.. with default values in it based on the parent parameter.
Say Team1 and Team2 are values for Parameterteam (parent parameter).. have this as a multiselect parameter so you get select all.
Then based on your selection on parameterteam, have another parameter called parameterteammembers. This parameterteammembers will gets it's value based on Parameterteam.. makes sense?
I do not think what you want to achieve is possible in SSRS
Related
I have two issues with SSRS.
I have cascading parameter. User selects first parameter (#place) and on that
basis last two parameters (#group and #cost) should grey out. Currently Only
the last parameter (#cost) greys out, not the second last (#group) getting
"select a value". If I swap the order then the #group greys out and #cost
does not
When I run the report in my local system, the cascading parameters only works for first time. When I change the #place parameter value then the rest parameters do not update..
Update: Mock Example below:
This is the issue in pic above. When C is selected I want both parameters to be greyed out. In first picture, I have mentioned Null for both when C is selected
I have created a dummy project with other fields in order to solve this scenario. My fields are LAST_DATE_EDITED, ID and FEE_AMOUNT in which ID and FEE_AMOUNT are dependent of LAST_DATE_EDITED field.
In order to do this, I created 3 datasets for each parameter. For LAST_DATE_EDITED I put only a SELECT LAST_DATE_EDITED from test table. For ID and FEE_AMOUNT I did as below:
In this way, I achieved the following output:
I hope that I understood correctly and this will help you.
I need to export my SSRS report to csv format. Issue I am facing is that few column header names change with country code (parameter) and I want to show the same name in my exported csv. I have gone through other related questions and topic, specifically this one. It suggested that there is a work around by setting data value to null. I have tried this by adding columns and hiding these based on country code, along with setting data value to null for that dataset field. But it did not work. I still get the hidden column in my export, with no values in it.
Can someone confirm that this workaround works or is there any other way apart from creating different reports for each country?
UPDATE: (added report screenshot and description for clarification)
Based on apporoach I have taken,
I need to only show Column 'Town' for Country A and only 'Suburb' for Country B. This is easily done by hiding columns based on Country Parameter( and works fine for EXCEL export), but when exported to CSV, both columns are exported.
UPDATE 2
Found this link which is similar to what I have been trying to figure out and looks like there is no solution which can be achieved using only one report.
According to this post
MSDN Social: Hide CSV columns conditionally in SSRS report
The XML and CSV renderers use the DataElementOutput property to
control visibility. We can select which item we want to hide in the
report, and set the “DataElementOutput” property with value “NoOutput”
to work around the issue.
Alternatively, we can add below expression to control the item’s
visibility. Please refer to the expression below:
=IIF(Globals!RenderFormat.Name="CSV",True,False)
This, incidentally, is the second answer in the thread that you posted. That answer links to the following article which explains how to do exactly what you need
Hide/Show Items Dependant On Export Format
UPDATE
It appears that you cannot programmatically set DataElementOutput for CSVs. However, according to this post SSRS - Programatically controlling the DataElementOutput property
in RS 2005 / 2008, you should be able to get the desired effect by adding a filter on the tablix directly (in addition to the visibility condition):
Filter expression: =(Parameters!DataPeriod.Value = "DAY")
Filter operator: =
Filter value: =true
Thereby, for the cases where the tablix is not visible, you are also filtering out all the data.
You may be able to show/hide country specific columns this way instead.
My approach would be to do this in SQL. I'm not sure how you determine which Countries require the town to be returned and which require the suburb to be returned but here's a couple of approaches that hopefully cover your scenario.
In either case, the idea is to return the town/suburb data in the same column and then an additional column that will contain a a caption that we can use as the column header.
a. Only one of either the town or suburb column in your table is populated. In this case it's pretty simple.
SELECT
Country
, ISNULL(TownOrCity, StreetSuburb) AS TownSuburb
, CASE WHEN TownOrCity IS NULL THEN 'Street-Suburb' ELSE 'Town-City' END AS Caption
FROM myTable
b. You know upfront which Countries require what and you can pass a parameter in to get the correct column. In this example we'll use a parameter called #TS and pass in either a T or and S
SELECT
Country
, CASE #TS WHEN 'T' THEN TownOrCity ELSE StreetSuburb END as TownSuburb
, CASE #TS WHEN 'T' THEN 'Town-City' ELSE 'Street-Suburb' END AS Caption
FROM myTable
Whichever approach we take you will end up with a simple table
Country TownSuburb Caption
Testland TownA Town
Testland TownB Town
Testland TownC Town
In you report, you don;t need to do anything except make the town/suburb column caption an expression something like =FIRST(Fields!Caption.Value)
That's it, the report is now nice and simple and should export without any issues.
UPDATE to method:
--
-- Dump data into a temp table
--
SELECT
Country
, CASE #TS WHEN 'T' THEN TownOrCity ELSE StreetSuburb END as TownSuburb
INTO #t
FROM myTable
--
--rename the column
--
DECLARE #NewColumnname sysname = CASE #TS WHEN 'T' THEN N'Town-City' ELSE N'Street-Suburb' END
EXECUTE tempdb..sp_rename N'tempdb..#t.[TownSuburb]', #NewColumnname, 'COLUMN'
--
-- finally get the result
--
SELECT * FROM #t
Currently, I have a tablix that shows Number of Records by Group and if they were Completed on Time. Tried to show best my Tablix in the picture below:
I only have 5 different groups that show up in my Groups column.
Groups:
Group1
Group2
Group3
Group4
Group5. There are currently actions attached on each value in the Number of Records Column.
I'm trying to include an expression in the Action portion that will help me to direct the end user based on a particular Group. For example, if the user selects a value from Group1, Group2 or Group3...I would like them to be directed to my Drillthrough Report "Drillthrough01". If the user selects a value from Group4 or Group5...I would like them to be directed to my Drillthrough Report "Drillthrough02".
I tried to do an expression below (I know it's wrong, but it's along the same lines of what I'm trying to do)
=IIf(Fields!Group.Value = "Group1, Group2, Group3", "Drillthrough01" , "Drillthrough02")
Not sure if anyone could help with fixing my expression or if they know a better way. Please let me know if need more information on my end.
With Alan's help, I basically used the IFF statement above with some slight edits and incorporated my IFF with multiple conditions using OR and got it to work.
At the run time user will select the country for which the report
should run.
Next we will show all states of the selected country on parameter
screen.
Next we will show all cities of selected state on parameter screen.
How can we achieve this?
I'm not really sure, but here's what i think:
Create Your Parameter
Set your parameter value based on others parameter value, and send it to parameter data set to retrieve its data. (maybe you can use expression to do this)
Hope it would help :)
Regards,
David Tan
I could achieve it.
I created first a dataset for my report with Country, State and City fields.
After this, first parameter is country, user will select the country at run time.
After this, I have added another dataset2 to select all the states based on first parameter. I created another parameter to show multiple states. For this parameter I provided 'available values' as the second dataset viz., dataset2. This dataset2 was accepting parameter country and populating the states at the run time. I provided 'default values' as well as dataset2.
This same way I implemented the 'city' parameter. It worked.
Thank you!
Yes we can achieve that.
Let say you have two dropdownlist as a parameters, A and B.
You give A list of data from dataset
for B, you use dataset too to retrieve the data, but when you create dataset for B add filter and set parameter A as its value.
Add Filter for paramater B and set A as its value
Hopefully it would help :)
Thankyou.
Create three different parameters as country,state and city in your dataset and add one line to the dataset query as where country = #country and state = #state and city = #city.
Now coming back to your question, If your sql has duplicate countries,state or cities it wil return duplicate values so create three different datasets for three parameters.Like "Select Distinct country from Person.country" and state is dependent on country so write query for state as "Select Distinct state from Person.Country where Country = #country" and same goes for city.
Hope this answers the question
I've got a table with 5 columns, the first 3 of which allow the user to drill down through the levels of detail. Each of these columns (Region, Country & Office) has an associated Parameter so the user can select the geographic region for their report. Each parameter allows the selection of multiple values.
If the user selects 1 Region, 1 Country and 1 Office it's not exactly ideal for them to then have to expand each selection. Is there an expression I can enter somewhere to state that if only 1 value is entered in a parameter then that data set will automatically show as expanded?
This is in SSRS 2008 R2 if that makes any difference.
In the Group Properties for the detail group you can enter an expression for the initial visibility. Right now you probably have that set to "Hide." The expression needs to return a Boolean and could be something like:
=Parameters!Country.Count <> 1
This will have SSRS hide those rows if more (or less) than one value are selected in the parameter Country
But I have seen some unexpected results with this: test thoroughly. In my experience, BIDS handles these better than SSRS itself, so just when you think you've got it all working, it fails miserably once deployed. (Reason number 14 to have a test folder on production SSRS.)