SSRS - Cascading Parameter? Parameter value then shows two other parameters? - reporting-services

Apologies if this is rather straight forward. I'm very new to SRSS and looked across for a solution but unfortunately at a point where I don't know how to proceed.
My report has 1 parameter at present (Choice a Yes/No option - which is also set in the where clause of the dataset = Where Choice = #choice....
The issue I'm having is if Choice is Yes by user, I want it then to show two date parameters of Month and Year, then require user to select these and then view report. I've come across Cascading Parameters but correct me if I'm wrong this is related to the first parameter in this case Choice. However, the yes or no is a derivation from a case statement it has nothing to do with the date and they are not related from a database point of view. So not sure how I can get this to work. Do I need to add an expression?
I need two parameters showing when Choice = Yes
I then need to know how to add this to the dataset (if only yes has been selected).
Sorry once again this might be straight forward, but I'm been trying for a couple of days with no success.
Thanks in advance.

First of all, you cannot conditionally hide parameters, so all 3 will need to be visible from the start. However, you can control how they behave to get better functionality.
I would suggest adding a dataset to the report that provides a list of years. This dataset would be used to populate the Available Values for the Year parameter. You can have the query here check the Choice parameter and if it's set to "No", then the query simply returns "Not Applicable". So the dropdown for year just has that one option as is essentially disabled. Repeat the same steps for the Month parameter and dataset.
You will also need to make sure the main dataset will handle these values. So the WHERE clause might look something like this:
WHERE (Year = #Year and Month = #Month) or #Year = 'Not Applicable'

Related

Combining multiple drill through reports into one

First time posting here so please be kind.
I've come from using PowerBI to achieve pretty much everything I need to with a couple of clicks to using SSRS 2008... and I'm having a hard time. Here's what I'm trying to do:
I have a main report that summarizes some data on how long it takes to close down help desk tickets. On that report I have a table with summary figures (ie 220 tickets were picked up after 5 working days, 18 tickets were reopened etc). I want to click the text-box that contains 220 and be taken to a drillthrough report that contain the same table with column headers and just different row sets in each case. There will be 8 drill through actions in total and I currently have 8 drill through reports. Only 2 of those are parameter based, the others just filter the dataset based on some conditions.
What I'm trying to work out is this: can my 8 drill-through reports be rolled into one, if they're just different views of the same dataset? I've created some calculated columns with values (Yes/No because boolean doesn't allow multiple values) which are easier to pass to parameters. I also have 8 parameters on my detail data set. I've set up actions (where parameter1 = yes for instance) to take me to my detail report and use the corresponding parameter each time. It should work... but it doesn't and I can't work out why. Currently its' complaining that I can't compare a boolean to an int16 - neither the value in my calculated column nor the default parameter value is boolean or int. So, am I trying to do something that just isn't possible? Has anyone else achieved this?
Edit: here's the parameter
The error I'm getting is
The calculated column that should be checked against the parameter is
=IIF(IsNothing(Fields!DatePickedUpByAgent.Value), "Yes", "No").
Here's how I defined the action to take me to the drill through report in this case
Here are the filters on the subreport dataset based on the parameters passed through from the main report. "NotYetPickedUpByAgent" is the example we've been discussing here. enter image description here
Could you please go through each of your parameters one by one.
I would suggest deleting all the filters and trying to run the report and subreport.
Then keep adding filter one by one.
I think issue can be any of the filter and not the one you think.

SSRS report with "Checkbox"-like feature that adds filters to query

I have a SQL database and using SSRS to produce reports. They are both 2012 version. The data is well water levels that are record every hour. Originally I have the report displaying ALL of the data for a user selected well (dropdown list). The user can also select the start and end date (text box) But the well levels don't change that much every hour unless there is a significant rain/flooding event. So I want the user to have the option to choose only the noontime values for each day. Is there a way to have a checkbox that would either 1) change actual query the report is using or 2) include filter that says only display 12:00:00? The parameter options seems to want to include a date and I only want to filter by time.
Thanks
I think the solution for you is to add a parameter to your report to be able to select what information to show with 2 possible values - All / Noon only. Then add a new field / calculated field to your dataset to indicate which ones are noon values. Then use the new parameter to filter the values showed in the report.
Hope it makes sense.

SSRS ignore a field result

I guys
I'm having a slight problem with a report im currently writing.
So when i run this report it gives me a list of outcomes from a data source.
One of results is 'Closed' I want to exclude this outcome in my report. I cant exclude this in my SQL code as it doesn't bring back the null values. ( when no outcome has been given to a task yet i.e no one has had the time to do it yet i have set that in the expression to 'No Outcome'.)
So i want to know if anyone can edit my expression so it does not bring back the value of 'Closed'
=IIF(IsNothing(Fields!OutcomeDescription.Value),"No outcome",Fields!OutcomeDescription.Value)
Any Help on this would be great sorry if iv not explained this well.
Rusty
To do this, you'll want to add a filter to either your dataset or your table object - whichever is most appropriate for your needs.
For a dataset filter, merely open your dataset properties, and look for the filters tab. For a table, you'll need to go into the tablix properties. Setting up a filter from there is simple.
Filtering at the dataset level will drop all of the filtered records before any controls on the report could access them. Filtering at the object level would drop the filtered records from the control, but they would still be available to other controls. If your report only consists of a single table, and no additional objects, I'd recommend filtering on the dataset.

Working with parameters in SSRS 2008

I have an (either or) situation in regards to parameters in SSRS 2008. I currently have my report working with a date range but I've been asked to add a drop down for the user to select the weekending date. I've got that drop down working but how can I switch between parameters (Date Range and the use of the Weekending Date drop down) for sending parameters to my report?
The way I allways fix this is by setting the parameters as nullable.
Then in my sql script I select all dates on the weekending date or between the daterange:
So whatever the user specifies, your sql script is filtered based on their parameters.
select *
from [table] t
where t.[date] = #WeekendingDate
or t.[date] is between #DateRangeFrom and #DateRangeTo
I usually handle this situation by creating an Internal Parameter(s) to sit between the UI and the query or stored procedure. The Internal Parameters are driven by expression depending on the user selection.
so lets say you want the user to either select a begin and end date range(Begin: 2012-01-01 End: 2012-01-31), or a month (Jan 2012).
If they select a value for Month. I convert that to an equivalent date range in the internal parameter expression. If they enter a date range I just pass through the begin and end values to the internal parameters.
Hopefully this makes sense. with a little work and imagination I think the approach can handle most scenarios.
One possibility would be to use the version control system of your choice to make another branch for the second report, change that one to use Week Ending, and then just make sure you merge changes every time you make a change to the main report.
I'm sure someone will come up with a cleaner way to handle it, though...

SSRS: How to make a sum that only includes the last item in a group

I have an rdlc report file, and I am trying to make a sum which can only include the last item in each group. I have a table kind of like this:
Place = ? (Group header 1)
User = ? (Group header 2)
Date =Last(Fields!Number.Value) (Group header 3)
Number =Fields!Number.Value (Detail row)
So, in other words, in User there, I want a sum of Date... if that made sense...
The Numberrows contain many numbers per Date. But Date shows only the last number for that day, because the rest doesn't count (but must be displayed) In User I want to sum up those last numbers for all the dates for that user. And same with Place (which would be the sum of every last number for every day for every user).
Could anyone help me with this? I tried the obvious (to me at least) =Sum(Last(Fields!Number.Value)), but (also tried to specify the group in those functions, but didn't make a difference because) I get an error when I try to compile which says:
The Value expression for the textbox 'numberTextbox' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions.
Which I guess kind of makes sense... but how do I do this then?
Update: I have solved the issue by adding another column, and copying those last numbers into that column. This way I can display all the numbers, and do the summing on the column that only contains the ones that is going to be in the sum. I am still very curious to if anyone have a solution to my original problem though... so please post an answer if you do!
Not sure I understand exactly what you're trying to do. Maybe something like =Last(Fields!Number.Value,"Group 1") + Last(Fields!Number.Value,"Group 2") + Last(Fields!Number.Value,"Group 3"), instead using a sum function?
the easiest way to do this would be to modify your dataset to only include the records your are displaying in the date field, that way you could just use a simple sum() instead of trying to do something weird and screwy and might not work.
Modifying the data set may really be the simplest solution, but if you really wanted to do this without complicating the query you could try "custom aggregation".
The exact techniques for this depend on the version of SSRS, and my understanding is it didn't really work that well before SSRS 2008.
The idea is, you write some custom code to maintain an array containing the last value for each date. One function updates the "last value" for a date, and another sums the values in the array. Your header calls the latter function; you conspire to cause the former function to be called once for each detail row before the header is processed.
Here's a blog with a write-up that explains the technique in SSRS 2008.
It also gives some insight into how you can try to make this work in SRSS 2005, but again apparently that's not as reliable.