SSRS Date Parameters - Setting Date B = Date A whenever Date A is changed - reporting-services

I am looking into a query from one of our users regarding the behaviour of date pickers on their report.
They have asked that when they enter a date in Date Paramater A that this is then duplicated in Date Parameter B.
I can achieve this when the report is first run by given Date Parameter A no default value (so it has to be chosen by the user) and seet Date Parameter B's default value via an expression to "=Parameters!StartDate.Value".
The question though is wether or not I can recreate this when Parameter A is updated. Therefore if they run the report once and then decide they need to choose another date. Can I set Date Parameter B to refresh each time Date Parameter A is changed?
E.G
Report is opened
Date Parameter A is set to 02/12/2013.
Date Parameter B now defaults to 02/12/2013.
Search is performed
A second search is required so, without closing the report the user changes the date in Date Parameter A
Date Parameter A is now set to 05/12/2013
Date Paramater B still says 02/12/2013 - can I somehow make this auto refresh to match Date Parameter A if Date Parameter A changes?
EDIT: Thanks to Kalim for pointing this out but it must also be noted that although I would like Date Parameter B to default to the new value selected by Date Parameter A, dates greater than that selected for Date Parameter A must also be available in case they wish to widen the range of dates.
Hopefully that is clear, but if any further information is required then please let me know.
Thanks in advance for your time and help.

You should be able to set the "Available Values" to the value of the first date parameter.
Select "Available Values" then select the "Specify values" option. Add a value and edit the expression of the value. Set this to the same expression you used in your default value expression.
Hope that makes sense!
Screenshot:

Related

Can you set a parameter that references an expression field that is calculated based on another parameter selection?

I am attempting to create a parameter which looks at the values of a field in the report which is calculated based on the entry of another parameter.
Specifically, the first parameter is a number option (30,60 or 90) and the field expression is a DATEADD that adds the parameter value to the value of a date field.
The next parameter I need is to pick dates in the "expression field" that fall into a certain range. i.e. user chooses 30 so the report generates and populates the "Hire Date" + 30.
I want to then only select the records where that new date falls into a specified range i.e. Effective Date 2/1/2020-2/29/2020. I have been looking everywhere, but cannot find an answer and I don't know if it is possible.
Results example
[EffDate Field[\]\[1\]][1]
I think this was what SuperSimmer 44 was referring to that I couldn't understand before.
I added the following parameters:
Wait - which is an integer & has set available values of 30, 60 & 90
From - Date
To - Date
I kept the field "Effective Date" in my report which was the expression =DateAdd("d",Parameters!wait.Value,Fields!HireDate.Value)
I then added a filter to the Dataset that said if the value of the expression =DateAdd("d",Parameters!wait.Value,Fields!HireDate.Value) was between #from & #to then they should include the record in the results. It worked perfectly.
Report Sample
Insert 2 parameters, one called qty to hold available values from a list 30/60/90 or 120 etc
the other called date to hold your from effective date.
Set up a calculated field in your dataset called effectivedate that utilised DateAdd, for example ie: =DateAdd("d",Parameters!qty.Value,Parameters!effectivedate.Value)
Then set a filter on your dataset that utilizes this calculated field.

set default value for date time parameter in rdlc

i have a report which has extension of rdl (Microsoft Reporting Services Projects) in visual studio 2017 and this report has a date time parameter
i want to set a default value for this parameter as current date in order not to force a user to choose a value for this parameter
so when i right click the parameter i choose Default Values then Specify Values
then i add the Value =Now()
with no benefit when i preview the report the date time parameter becomes disabled
how to enter a default value as current date without time value
Your only question seems to be:
How to enter a default value as current date without time value?
To do this, rather than using =now() which returns the current date and time, you can use =today() which returns just today's date.

SSRS set default values to display 1/1/1900 and 1/1/9999

I have two parameters start date min and Max both are optional parameters. I have the allow null values unchecked as that is the requirement. But by default need to
display 1/1/1900 in the Min date text box
and 1/1/9999 in Max date textbox.
I tried setting this value on my parameters properties using Datetime.MinValue which displays 1/1/0001 in my text box.
But when I run the report I get the error date time needs to be between 1/1/1753 and 12/31/9999
And for max date textbox I tried to use Datetime.Maxvalue and it throws error "MaxDate" is not valid for its type.
Could anyone shed some light on this please?
The answer is simple you cannot set a minimum or maximum value for Parameters in SSRS, yes but you can provide a default value of 01/01/1900 for your datetime parameters.
Go to Report parameter properties and set a default value there.
When the report executes it will show the following:
You have little control over what user selects, hence using a stored procedure to validate the passed values from the end users is another option.

What is the correct format for SSRS datetime parameter on Subscription page

I have a report which takes two dates as parameters. This is meant to be automated report, send regularly via subscription to certain users. Let's say I want dateTo to be today and date from to be today - days.. I can't figure out the format or formula that would do this in these fields... I am getting :
One or more report parameters have an invalid parameter value.
Thanks for any help!
Make another parameter like #ReportPeriod, that accepts either "Daily", "Weekly" or "Monthly", and the subscription sets the value of that. Then hide the Date parameters and set them inside the report based on the ReportPeriod chosen.

SSRS 2008 R2 chained parameters

I have a report with three parameters: A country combo box, a start date and end date (of the fiscal year). I want the start date and end date to be updated depending of the country combo box selection.
I made a dataset that receives the country code as a parameter and returns the start date and end date for the selected country. Then I linked the default value of the dates to the dataset.
This works perfectly the first time a country is selected but not for the subsequent country selections. If I change the type of the dates parameters to combo boxes it works every time but I don't want to lose the flexibility of "fine tuning" the dates after the country is selected.
am I asking the impossible?
Microsoft regard this behaviour as being by design - see this Microsoft Connect issue.
There is a workaround in general - the dependent parameter gets refreshed when its values are invalidated by the selection in the first parameter.
However, since you want the users to be able to override the start and end dates, you can't specify that the default values for the country are to be the only values available.
What you could do would be to add a second country parameter after the first, whose default and only available values are the value of the first country parameter, and to set the default values of the start and end parameters based on the value of the second country parameter.
Unfortunately, if you set the second country parameter to be hidden, its default value does not get populated - so the second country parameter would have to remain visible, for this to work.
You could make use of this - for example, by displaying the default date range for the country as the label for the parameter; this would enable the user to see where the default date range has been overridden.