user3725135
user3725135

Reputation: 69

how to disable 2nd parameter we select 1st parameter in crystal reports

Please guide how to do this requirement.

I Have a report having 2 command level parameters a and b. If they select any of the one parameter then other one should be disabled/should not ask any value to enter /should not take any value . Please suggest how to do

Upvotes: 0

Views: 1345

Answers (2)

Lan
Lan

Reputation: 1346

This should be a feature of the user interface. You can implement it if you write your own software. The only viewer , which MIGHT be able to do this is R-Tag (www.r-tag.com). But even it will need to do some workaround ( if can do it at all). This behavior is very unique. Why would you need to have it ?

Upvotes: 0

craig
craig

Reputation: 26262

Command don't support optional parameters. Moreover, you can't disable or hide a parameter based on another parameter's value.

Your best option is to create a parameter that has a default value that will be 'ignored' by the query.

For example, given this Access command:

SELECT *
FROM customer 
WHERE region='{?Region}'

with this parameter:

enter image description here

you will note that the parameter's Optional Prompt setting is false (and not editable):

enter image description here

Instead, you will need to a default, something like 'ALL' (or -1, in the case of a numeric value):

enter image description here

Modify the command accordingly:

SELECT *
FROM customer 
WHERE ( '{?Region}'='ALL'  OR region='{?Region}' )

Upvotes: 1

Related Questions