Default Report Parameters to Current Date (or some function)
I am building a report, with parameters for a date range - StartDate, EndDate, that kind of thing. I see the Parameters Tab has a "Default Value" box, but it seems that it does not want to accept a formatting or function value such as
I don't want to hard code in an ACTUAL date, but rather, am trying to find a way to make the default value be something like "Current Date", or "1st day of current month", etc. Can i put in a date function in the DefaultValue?
***Updated by moderator: Marissa to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Actually you can use any of the symbolic dates that the filters allow you for DateTime properties as default value for your DateTime parameter(s). To see the list of allowed symbolic dates, click on "Select values” next to a filter. This will show you "Time Periods” where Today is present among others.
Actually we're talking two different things. I'm not talking about the Query page, but the Parameters page...if i do that on the query page, it's no longer looking at the parameter. The parameter screen does not allow "Select Values"
As I said, the values that are visible for filters when you click on "Select values” are the same values that you can use as default value when you define your parameters. I am not asking you to choose that value for the filter. I was just trying to point out where you could get the list of allowed values that you could use in the default value field for parameters. The right hand side of the filter will still say Param.StartDate
I think the default value on the parameters tab (at least for activity rules, not sure if this is different for the parameters tab of other rules such as report ones) only applies for manually driving the rule with the "run" button from the ruleform, and that the default value of a parameter shown on the parameters tab is not applied if the rule is called from the user's app. /Eric
Thanks Rajiv. So, I’m curious now, if the default value for a parameter is specified as “.foo” on the parameter tab, how do you know whether the value should be those four characters literally, or whether it means at-the-time-the-rule-starts-fetch-the-contents-of-property-foo ? /Eric
I think I have it working now, Eric. Here's what I did
- Created a report, with query WHERE conditions at the bottom
- Created Parameters ("StartDate", "EndDate") and defaulted them to "Current Month"
- Set the Query to reference Param.StartDate and Param.EndDate
- Set the Report Viewer tab to "Prompt for filter changes before displaying a Report"
Now, in the Case Manager Portal that the user sees, when they run the report, they are prompted for the dates (and the defaults are displayed). If they don't change anything, it runs for the current month. If they change them, it runs for the date range specified.