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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter to point to one choose or ALL

Status
Not open for further replies.
Mar 10, 2003
25
GB
Hi

Crystal v8.0
I have set up a parameter (Country of Residence). The customer access the report via a web viewer. So the solutions open to me, e.g. Discrete and range values. So the customer must be able to choose a country, or ALL of them. I recall something about a "8" representing all available values. Can someone shed some light on this - or similar way I can perhaps solve this.

Thanks,
Etienne
 
Add a default of 'All' as the first choice in the parameter.

Then construct the record selection formula something akin to (assuming that you have a multi choice parm):

(
If {?MyParameter}[1] <> 'All' then
{table.filed} = {?MyParameter}
else
if {?MyParameter}[1] = 'All' then
true
)

Now if they select 'All', it doesn't pass anything to the database, hence you get all rows, otherwise it will pass the appropriate SQL to the database. Note that I purposefully construct it using else if to help assure SQL pass through.

-k
 
Just one more twist in the tale.
I now know how to include only one parameter, or all (represented by (e.g.) '*'. We run the reports on ActiveX viewer, and that is quite limiting when it comes to parameters. How would it be possible to enter a parameter 'strarting with' 'xyz''*' where '*' = anything.
It is not a problem doing this in my version of Crystal (v8.0), but it becomes a problem when you view and generate the reports via ActiveX.

Any ideas?
EO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top