Myles
Tue Jun 14 15:36:07 CDT 2005
Excellent David - thank you! Yes I noticed if you un-check the 'has default
value' check box, the problem does go away and you retain the expression
based value. This is good to know! Thanks!
Pete
"David Siebert" wrote:
> I've noticed this also. I've gotten around it by unchecking the Has Default
> boxes for any parameters that have a calculated value. The calculated
> default values will still be there after you apply changes, and if you go
> back to the properties page, you should see that the Has Default boxes are
> checked again. I don't know if I would really consider this a major bug, but
> a bug it may be. You can definitely use expressions as default values, but I
> will caution you that using them can cause odd behavior when editing the
> default values when actually running the report. If you have defaults that
> are expressions and you change a parameter value, it will recalculate any
> calculated default values for all the parameters after the one changed. This
> is in order to allow cascading parameters, and can't really be changed as far
> as I know. I actually use calculated values a lot (for dates e.g. beginning
> of month, end of month, two weeks ago, etc.) but in order to get around the
> odd behavior of cascading parameters, I will use sql to get the default
> dates, and then set the default in VS to "From Query" and this manages to
> work around the recalculation issue.
>
> Hope this helps.
> David
>
> "Myles" wrote:
>
> > Thanks David -
> >
> > actually, the parm type is a string - I believe that is the only way
> > something like
> > =Left(today, 10) would work, because it is a string function (basically).
> > It is trying, though, when you open up the parameters page of the properties
> > tab on
http://<Server>/Reports and fiddle with a completely different
> > parameter and try to apply the changes, that it gives you the error on any
> > string type parameter that has an expression based default value. I would
> > think either you can have an expression as a default value, or you can't -
> > the ability to assign the default through the designer makes it appear that
> > that is ok, while later fiddling through RS makes it seem like it is wrong -
> > do you think possibly it's a bug?
> >
> > Thanks,
> >
> > Pete
> >
> >
> >
> > "David Siebert" wrote:
> >
> > > The reason you aren't seeing any value in the Default Value box is because
> > > your default value is an expression. The Default Value textbox on the
> > > Parameters property page only displays default values when they are strings
> > > and not expressions (this does not mean that you do not have a default value
> > > when it is an expression). The reason you might be getting an error is if
> > > your parameter type is date, you're returning a string instead of a date. I
> > > don't know what your parameter type is, but it is just a thought. Hope that
> > > helps you a bit.
> > >
> > > David
> > >
> > > "Myles" wrote:
> > >
> > > > I think you can try setting the default value in VS (designer) as
> > > >
> > > > ="Yes" instead of Yes
> > > >
> > > > see if that works.
> > > >
> > > > That being said, I am having some difficulty because it appears setting
> > > > things in the designer (for parameters) and setting parameter properties on
> > > > RS behaves in different ways. The prompt user, prompt string, default value
> > > > etc. seems to not be communicating clearly with what was set in the
> > > > designer. Example - if you have a date parameter, and in the designer you
> > > > set the default to be =Left(today, 10) - an expression, in other words - when
> > > > you go to look in RS and tweak the parameter properties it has default value
> > > > checked, but it does not sjow the expression and it doesn't see any valid
> > > > default value - and gives an error.
> > > >
> > > >
> > > > "anandr" wrote:
> > > >
> > > > > I have a report which takes few parameters. I have set some defalut value for
> > > > > them. The default values work good when i Preview teh report. But when i
> > > > > deploy the report to the Report Server, the default values get lost and the
> > > > > user has to type them all again. Any clue on how to solve this issue?