在cognos中,我们是否可以避免在查询的数据项中使用其参数时出现提示输入值的可选提示? [英] In cognos, could we avoid an optional prompt asking a value when its parameter is used in a data item in a query?

查看:224
本文介绍了在cognos中,我们是否可以避免在查询的数据项中使用其参数时出现提示输入值的可选提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上,我在Cognos 10.1 Report Studio中工作。在我的报告中,我有两个提示,一个是可选的,另一个是必需的。在某些情况下,我已经在数据项中同时使用了两个提示参数。因此,可选提示也变成了必需。为避免这种情况该怎么办?

Actually, I'm working in Cognos 10.1 report studio. In my report, I have two prompts, one is optional and another prompt is required. I've used both the prompt parameters inside the data item for some condition. So, the optional prompt has also turned to required. What should we do to avoid this?

推荐答案

为此,我们可以使用#prompt()#。通常,使用#prompt()#故意强制参数保留某些值。而不是直接使用参数,我们应该使用#prompt()#。

We can use #prompt()# for this. Usually, #prompt()# is used to deliberately force the parameter to hold some value. Instead of using the parameter directly, we should use the #prompt()#.

例如,

假设 Parameter1在数据项中使用,它包含一个整数值,用#prompt()#代替它,例如#prompt('Parameter1','integer')#。

Suppose, ?Parameter1? is used in a data item and it holds a integer value, replace it with a #prompt()# like this #prompt('Parameter1','integer')#.

假设条件是

if(?Parameter1? is not null)
{  
   statement; 
}

应该是

if(#prompt('Parameter1','integer')# is not null) 
{
   statement; 
}

如果我们使用#prompt()#,则可以在数据项,而不会影响提示的使用。

If we use #prompt()#, we can use the parameter inside the data item, without affecting the prompt's usage.

这篇关于在cognos中,我们是否可以避免在查询的数据项中使用其参数时出现提示输入值的可选提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆