After inserting a date/time parameter with an expression as its default value into a Microsoft SQL Server Reporting Services (SSRS) 2008 R2 report, I noticed that the date/time control would be disabled when I’d preview the report. Strange.
This problem only exhibits itself when the date/time parameter’s default value is an expression (say “=Now“). If the default value is not set or is set to a literal value (like “1/1/11“), the control functions as expected—it is enabled. Also, the date/time parameter must be preceded by another parameter. The other parameter must require the user to enter a value (null values disallowed, no default value set).
My Guess As To What’s Going On
The date/time control won’t enable itself until it evaluates its default value expression. It won’t compute this expression until the proceeding parameter has been set to a value (via user entry, a default value specification, or because nulls were allowed so the value defaulted to null). My guess is that this evaluation delay is intended to allow this parameter’s expression to use the proceeding parameter’s value in its computation.
Now that I’ve thought it through, this behavior makes sense—but it caught me by surprise at first.
Need help with a Microsoft SQL Server Reporting Services (SSRS) project? Drop me a line!