cancel
Showing results for 
Search instead for 
Did you mean: 

Optional parameters in Crystal XI R2

Former Member
0 Kudos

Hi,

I have to create optional parameters in CR XI R2. The column names in database are not nullable. Hence I do not get the check for null button.

I want the parameters to be such that even if user doesnt select some parameters, and runs it only for the date range(mandatory) it will work.

I have created the following if else statements to pass default values. It works for only the first filter criterion and ignores the rest. Its not nested if else, so its failing.

Let me know if anyone has any other idea how to achieve this or if you can identify the flaw in the below logic.

if ({?S1FNAM} = "abc") then True else ({FILM.FSNAME} = {?S1FNAM})

and if ({?S1FLNO}= 0) then True else ({FILM.FFILNO} = {?S1FLNO})

AND if ({?S1CLNO}= 0) then True else ({NAME.NNAMNO} = {?S1CLNO})

AND if ({?S1CLNM}= "") then True else ({NAME.NSNAME} = {?S1CLNM})

AND if ({?S1THNO}= 0) then True else ({BSUP13.B2THNO} = {?S1THNO})

AND if ({?S1THNM}= "") then True else ({THEA.TSNAME} = {?S1THNM})

AND if ({?S1SALZ}= "") then True else ({BSUP13.B2SALZ} = {?S1SALZ})

AND if ({?S1CIRC} = 99999) then True else ({BSUP13.B2CIRC} = {?S1CIRC})

AND if ({?S1BRAN} = "") then True else ({BSUP13.B2BRAN} = {?S1BRAN})

AND if ({?S1TERM} = "") then True else ({BOOK.BBTERM} = {?S1TERM})

Thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shalu,

The functionality which you are looking for ("Optional Parameters) is not available in CR XI R2. It is available in CR 2008.

Insted of taking blank values in parameters, define default values and while checking/filtering in Record Selection, omit the default values and assign database field values.

Example :

Create a Static Parameter 'Slno' and assign 1 as default value.

In record Selection :

IF {?slno} = 1 then {?slno} =

Also check each parameter value independently.

Thanks,

Sastry

Former Member
0 Kudos

Hi Sastry,

Thanks for your response. I have resolved this by using default value and AND or condition.

If-else, was giving me wrong results when I had too many optional parameters.

Here is the working code:

and ({FILM.FSNAME} = uppercase({?S1FNAM}) or {?S1FNAM} = "ALL")

AND ({NAME.NSNAME} = uppercase({?S1CLNM}) OR {?S1CLNM}= "ALL")

AND ({FILM.FFILNO} = {?S1FLNO} OR {?S1FLNO}= 0)

AND ({NAME.NNAMNO} = {?S1CLNO} or {?S1CLNO}= 0)

It is more sound than anything I have used before. It is based on the logical construts AND OR.

Former Member
0 Kudos

Hi Shalu,

Great !!!

Thanks,

Sastry

Answers (0)