cancel
Showing results for 
Search instead for 
Did you mean: 

Mandatory parameters in crystal report

former_member212657
Active Participant
0 Kudos

Good morning, in the report that I created I have a string parameter and I need this parameter is not required because users do not always elect a data (customer group), made ​​so by not selecting anything in the field should show all groups in the report.

Is this possible?

Thanks

Angel Uribe

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member292966
Active Contributor
0 Kudos

Hi Angel,

Once a parameter is used in a Selection Formula a value is required. The best way to get around this is to have value your users can select to include all customer groups.

In your parameter, add a value like "All".

Now in your Selection Formula you can do something like:

If {?myParameter} NotEqual "All" Then 
    {table.CustomerGroup} = {?myParameter} 
Else {table.CustomerGroup} NotEqual {?myParameter};

Replace NotEqual with the LessThan GreaterThan symbols.

So what happens here is the formula will check the value of the parameter and if it isn't "All" then it will grab the Customer Group they select. If it is "All" it will look for all Customer Groups.

Good luck,

Brian

former_member212657
Active Participant
0 Kudos

Hi, thanks for the help. I use the parameter called from a stored procedure and then use the sentence also sent me this way

if {?} @ Group <> 'All'then

(OCRG.CodeName) = {?} @ Group

Else (OCRG.CodeName) <> {?} @ group;

But when I save I get a message that says:

Error in the formula needed) to close the parenthesis

Not that bad, I can continue to help?

Thanks

Angel Uribe

former_member292966
Active Contributor
0 Kudos

Hi Angel,

The syntax in your formula is incorrect. If you are typing this formula yourself, get the fields from the Field Explorer instead of typing them in. You are using the wrong parenthesis for fields and the name of your parameter definitely is not correct.

Your logic looks correct though.

Brian