Hi,
I need to have a pormptpage with optional ValuePrompt-parameters where I in the actual report later on uses the parameters in a query.
I.e.
1. I have parameter ?p1?
2. On the prompt page i have a ValuePrompt (with Property:Required set to 'No') as a dropdown where I if I want can choose one of the static values supplied in the prompt. I.e. I can select '1' or '2'. I also want the possibility to not select anything.
3. I have a query with a DataItem like "if(?p1? is missing) then ('0') else (?p1?)". Here is probably the error...
4. I have a report where I displays the value from the DataItem.
The problem is that when I run the report, the ValuePrompt on the promptpage is required! Is there any way to solve this?
Best Regards,
Mikael
Can you add a static value to the prompt of "None" or "0"?
Hi hauge9,
No, in my case that is not an option. The problem is just a subst of the report. In the "real" report I need to set values in the ValuePrompt with javascript, which works fine exept for that the required-status makes it impossible to press the "finish"-button.
Thanks anyway!
/Mikael
Hi
I think the problem is you're using the prompt as part of a calculation in a data item so Cognos needs the prompt to be requried. If you're using static values try adding another one such as 'none' for when you don't want to select anything, set the prompt to requried.
The data item calculation will then be something like case when ?p1? = 'none' then '0' else ?p1? end (I prefer to use case statements rather tha if then else but either should work OK)