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

Parameter to select parameter? 1

Status
Not open for further replies.

cathyg18

MIS
Mar 12, 2001
54
US
This is probably not as difficult as I'm making it to be, but I'm having difficulty untangling this process.

I want to have an initial parameter, which will control the parameter for the next level.

Example:

The first parameter would be something like
{?SORTBY}, with default values such as

COLOR
SIZE
MATERIAL

If 'COLOR' is selected, then field.color = {?COLOR), while SIZE and MATERIAL are all.

If 'SIZE' is selected, then field.size = {?SIZE}, while COLOR and MATERIAL are all.

etc..

I put in the selection formula:

If {?SORTBY} = 'COLOR' then field.color = {?COLOR}ELSE
IF {?SORTBY} = 'SIZE' then field.size = {?SIZE}ELSE
IF {?SORTBY} = 'MATERIAL' then field.material = {?MATERIAL}

but this is not working the way I want it to.

How can I set this up?

Thanks,

Cathy
 
I'm a bit confused. You have 4 parameter fields :
{?SORTBY}
{?COLOR}
{?SIZE}
{?MATERIAL}

The value of {?SORTBY} controls whether the selection criteria is based on {?COLOR} or {?SIZE} or {?MATERIAL}.

If the value of {?SORTBY} = 'color' then apply the selection criteria based on the value of {?COLOR}, if the value of {?SORTBY} = 'size' then apply the selection criteria based on the value of {?size} etc.

Is this correct?
Reebo
Scotland (Going mad in the mist!)
 
What does your report return at the moment and what do you wish it to return? Reebo
Scotland (Going mad in the mist!)
 
I placed the (?SORTBY} parameter in the report heading. When running the report, the parameter selection box comes up with ALL defined parameters immediately. I want it to only show the SORTBY until the user has picked their SORTBY option.

 
cathyg18,
Were you able to figure out the solution? I am having a similar problem. I need to have 3 parameters availabe, but have default settings for 2 based on the first one selected.
 
You can't set the defaults of parameters based on other parameters, but you can set values passed to the database based on just one parameter, for instance in the record selection formula:

If {?Top parm} = "Set defaults" then //whatever value
(
{table.value1} >= 100
and
{table.date1} >= currentdate-14
and
{table.booleanfield} = true
)
else
(
{table.value1} >= {?parmvalue1}
and
{table.date1} >= {?Parmdate}
and
{table.booleanfield} = {?Parmboolean}
)

Hope this helps.

If you post what you're trying to do, someone can probably help you here.

-k
 
Crystal doesn't support "Cascading Parameters" functionality whereby selections in one parameter restrict the values in a follow-up parameter.

You would need to use a 3rd-party tool (see a list at: such as my DataLink Viewer.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top