复选框组的默认选择
我想根据某些条件在我的 cognos 8 报告中放置复选框,即如果条件为真,复选框将出现并带有单击标记,如果不是则没有单击标记。
I wanted to put checkbox in my cognos 8 report based on some condition i.e if condition is true checkbox will appear with click mark and if it is not then without click mark.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您将此控件放在提示页面上...
这有点令人费解,但这是我知道如何做到这一点的唯一方法。 您可以在提示页面上放置 2 个“值提示”控件,并将两个控件的“必需”属性设置为“否”。 将两个提示的“参数”属性设置为相同(即,它们将对您的查询应用相同的过滤条件)。 对于提示之一,设置“默认选择”属性,以便在其中一个控件上自动选择默认值。 另外,请务必将“选择 UI”属性设置为“复选框组”(即使您只有一个要检查的值),以便获得一个复选框控件。
现在您的控件已设置完毕,您需要将它们放在提示页面上,并对两个控件应用条件渲染变量(如果您不确定如何执行此操作,可以在帮助中查找它 - 这很简单,但也这里描述起来很长)。 基本上,当您的查询条件为真时,渲染选中复选框的那个,否则渲染没有单击复选框的那个。 我不确定“渲染变量”属性的版本支持,但它适用于版本 8.4。
据我所知,没有一种方法可以通过将提示直接链接到查询来动态选择提示上的默认值——您必须采用条件格式化/渲染方法。
I'm assuming you are placing this control on a prompt page...
It's kind of convoluted, but here's the only way I know how to do it. You can place 2 "Value Prompt" controls on your prompt page, and set the "Required" property to "No" on both. Set the "Parameter" property to be the same for both prompts (i.e., they will apply the same filter criteria on your query). For one of the prompts, set the "Default Selections" property so that your default value will be automatically selected on one of the controls. Also, be sure to set the "Select UI" property to "Check Box Group" (even if you only have one value to be checked) so you get a check box control.
Now that your controls are setup, you need to place them on your prompt page and apply a conditional render variable to both controls (you can look it up in Help if you aren't sure how to do this -- it's simple, but too lengthy to describe here). Basically, when your query condition is true, render the one with the check box clicked, otherwise render the one without. I not sure about the version support for the "Render Variable" property, but it works in version 8.4.
There isn't a way to my knowledge to dynamically select a default value on a prompt by linking it directly to a query -- You have to go through the conditional formatting/rendering approach.
是的,我完全同意杰米的观点,这是唯一已知的方法。
还有另一种非常困难的方法来做到这一点是通过编写几乎相同的java代码。
所以我建议你坚持使用杰米的解决方案。
就版本问题而言,“渲染变量”属性在 Cognos 8 的所有版本(即 8.2、8.3 和 8.4)中的工作方式相同。
yes i completely agree with jamey this is the only known way to do this.
there is another much difficult way to do it is by writing a java code which pretty much does tha same.
so i suggest you stick with jamey's solution.
as far as the version question comes, the 'render variable' property works the same in all versions of cognos 8 i.e. 8.2, 8.3 and 8.4.