Optional prompt in Cascading prompt

I have a cascading prompt with 2 level. I want my Level 2 prompt to be made optional. I tried to do that by changing on the cascading prompt the second parameter to optional but that did not do anything. Can anyone explain how that works in Crystal reports 12.892


gogo (BOB member since 2005-06-03)

Hi,

You can define the optional prompt under the Values option during the creation of the parameter field. Since you are creating a cascading prompt, just change the Optional Prompt to YES for the second level of your prompt.


nahtanoj :philippines: (BOB member since 2009-07-08)

Do I need to change anything in the code in the Select Expert part to cater for the fact that no value is selected ?


gogo (BOB member since 2005-06-03)

Hi Gogo,

No need. You only need to define the the parameter you made under Select Expert by record


nahtanoj :philippines: (BOB member since 2009-07-08)

Ok I understand that but how do you change it from a mandatory to optional in the Select expert records ?


gogo (BOB member since 2005-06-03)

you can only provide an option from mandatory to option under the Parameter field option. You only need to apply the parameter field you created under Select Exert by records to filter the record you choose. Once you refresh the report the window prompt will display with optional function.


nahtanoj :philippines: (BOB member since 2009-07-08)

Indeed I can do that but everytime I change the second level of cascading prompt to True for Optional prompt it also changes the first level


gogo (BOB member since 2005-06-03)

Hi Gogo,

You may try this sample code then enter it under formula experts. Make sure you have parameter field maintain.


{Country.country} = {?My Prompt - country} and
{Region.region} = if(hasvalue({?My Prompt - region})=false) then {Region.region} else {?My Prompt - region}

for the second prompt, if no value has been selected it will return all values under that object.


nahtanoj :philippines: (BOB member since 2009-07-08)

Hi Gogo,

You may try this sample code then enter it under formula experts. Make sure you have parameter field maintain.


{Country.country} = {?My Prompt - country} and
{Region.region} = if(hasvalue({?My Prompt - region})=false) then {Region.region} else {?My Prompt - region}

for the second prompt, if no value has been selected it will return all values under that object.


nahtanoj :philippines: (BOB member since 2009-07-08)

Hi jbiason,

I’m looking into the same issue. The thing is whenever we change the second level parameter to ‘optional’, the first level is changed to ‘optional’ as well. And if you change the first level back to ‘mandatory’, the second level becomes ‘mandatory’ again.

Adding similar code to the one you suggested also doesn’t work. On the prompt window, we are forced to enter a value for the second level parameter which means it’s still regarded as ‘mandatory’.

Does anyone know whether this is possible at all to have different Values option (mandatory/optional) within the same cascading prompt?

Thanks heaps.


ivan (BOB member since 2004-10-04)