Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default Value for a Dynamic Parameter Prompt

Status
Not open for further replies.

bluecjh

Programmer
Mar 12, 2003
385
Crystal and Enterprise XI
Does anyone know how to set the default value?
for Parameter for using a Dynamic Cascading.. List of Values

I can't see an option?

thanks

BlueCJH
 
If you are publishing through the CMC you would have an option for the report parameters to set a default.

Thanks so much!
satinsilhouette
 
Satinsilhouette,

Thanks for that, it is definately an option,
but when users view a report
they don't get to see the default selection
which is a pity, I will definately go
with this but i'm baffled why there is
no default option for a dynamic paramter
within Crystal?

thnks again.

BlueCJH
 
no I take it all back, it doesn't seem to work for me.

I set a value for a parameter in the cmc
keep the 'prompt' user flag ticked.

But on viewing the report in infoview the drop down
boxes are not set to this choice and I am forced
to make a selection of somekind?

baffled?

any ideas, many thanks

BlueCJH
 
Please remember to post your database when asking about data.

Double click the Add Command above your database type in Database->Database Expert and enter something like:

select '...All' as 'City' from table
union all
select City from table

You don't post the database, table, field or field type that you intend to use, so I can't be specific, but the above method will allow you to UNION the All selection to your table, unless your database doesn't support a UNION, but almost all of them do.

The report will issue a warning about multiple data sources which you can ignore providing you don't use any of the fields from the Command Object in the report.

For future reference:

0 7112571

-k
 
I'm using Stored Procedures inside
my Business Views, I have my union
in my stored proc so that 'All' is an option.
The business view is working fine in
supporting the various 'list of values'
except that i can't get a default value.

we have hundreds of reports some with
maybe as many as 6 or so parameters, i'm
trying to avoid users always having to select
a value.
?

BlueCJH
 
The default value is currently what when they don't select anything?

So constructing the record selection may resolve, try something like:

(
(
isnull({?MyParm})
or
{?MyParm} = ""
or
{?MyParm} = "...All"
)
or
(
{table.field} = {?MyParm}
)
)

-k
 
they just see

..

that's it.

your code... i'm not using commands.. business
views.?

BlueCJH
 
the parameter was in the original SQL Stored Proc for
the report.

BlueCJH
 
The link above is not what is being looked for. I also have a stored procedure that returns the string literal ' ALL' UNIONed with a list of values. We DO NOT want to add every value in the parameter to any record selection criteria. Rather, if the user selects ' ALL' then the Record Selection criteria simply uses True to not decide anything based on this parameter - do not filter based on it. If they select anything else, the report processes that choice to create a filter condition.
Additionally, I bet that like myself BlueCJH is returning a compound field that embeds the actual filter value that needs to be extracted to perform the filtering on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top