Different question - is there any way to keep the default value functionality as found in a Static Prompt? It seems common sense it should exist, but I can't find it anywhere...
select '...All...' from table
union all
select field from table
And use that as the source for the parmaeter.
Now the first value is ...All... and you can code for it. If it's a numeric, place it in the description andsomething like -999999 in the value and display only the description in the prompt.
I had thought to do a union query and had already included an "!ALL" at the top. The user can select "!ALL" to get everything.
But the problem is I can't figure out how to make the cascading parameter use "!ALL" as the default.
In a static parameter , I could just place "!ALL" in the default value field and when the user refreshed the form, The description part of the "!ALL" would already be selected. But there is no "Default" section in a cascading parameter that I can find...
They can't exit a dynamic parameter prompt without entering something, or hitting cancel.
So try a formula of:
(
if not(isnull({?My Parameter}))
and
{?My Parameter}[1] <> "!All" then
{table.field} = {?My Parameter}
else
if isnull({?My Parameter})
or
{?My Parameter}[1] <> "!All" then
true
)
(
if not(isnull({?My Parameter}))
and
{?My Parameter}[1] <> "!All" then
{table.field} = {?My Parameter}
else
if isnull({?My Parameter})
or
{?My Parameter}[1] = "!All" then
true
)
I gave that a try, but the parameter screen still does not let me continue if I do not select a parameter for the cascading dynamic parameter.
It's probably because I am referencing that parameter directly in the SQL of the command that drives the report. I am doing so because I need the command to filter on the database side, not the client side.
It doesn't seem there is any way therefore to set a default value for cascading parameters...maybe next release ;-)
My DataLink Viewer has its own dynamic & cascading parameter implementation with the options to:
1) remember past choices and use those as the default
2) dynamically set the default value using a formula
- Ido
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
I almost have a similar problem with different scenario,
I have 2 different dynamic cascading prompts(dcp) with two each,
Say the first dcp has MOU_VAL and MOU_Region and the second dcp has Region and Center.
When the parameters are prompted prompts should be defaulted the following way,
If MOU_VAL = 'MOU' then prompt for MOU_Region and automatically force Region and Center to take 'ALL' values.
else if MOU_VAL = 'Non MOU' then prompt for Region and Center and automatically force MOU_Region to take 'ALL' values.
Each of the 4 values have '-ALL-' value coded on the database end.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.