Cognos下拉列表默认值设置

------需求:

第一次打开报表就自动输入默认值。

------解决方案:
在report studio内增加以下javascript.

[@more@]

------详细方案英文原版:

Title:
Javascript: Changing first line and set default selection in value prompt for 8.3

Document#:
1038662.3

Updated:
Dec 01, 2008

Applies To:
Cognos 8 BI Report Studio 8.3


SRs:
1


Collection:
KB



--------------------------------------------------------------------------------


Note: This technique uses JavaScript against underlying report objects and methods in a IBM Cognos 8 BI report. For this reason, there is no guarantee that reports created using this technique will migrate or upgrade successfully to future versions without requiring modifications. Any such modifications are the responsibility of the report designer.

Description:

The following is a sample Javascript that allows for the first item in a value prompt to be selected and the descriptive text of the value prompt to be renamed in Cognos 8.3.

Environment:

C8.3 Report Studio

Root Cause:

Prompt objects in Cognos 8.3 are now dynamically named. This is why methods such as:

document.formWarpRequest._oLstChoicesprompt1[0].text = 'Select a Order Method...';

document.formWarpRequest._oLstChoicesprompt1.options[0].selected = true;

may no longer work because of the way in referencing the objects. The solution below is one way to access the objects.

Solution:

Surround the value prompt with HTML items in Report Studio, then add a third HTML item at the bottom of the prompt page with new script

Steps:

1. Add an HTML item to the left and right of the value prompt in the Report Studio

2. For the first HTML item (left) add ''

3. For the second HTML item (right) add '
'

4. Add an HTML item at the bottom of the prompt page next to "Run" button

5. Add the following script for the third HTML item:



6. The value "A1" can be anything you like. Run the Report. This works well when using prompt page.

7. Add the following script if you don't want to use a prompt page, and want to use auto-submit in the value prompt within the same page as the list/crosstab. In this case the third HTML item is put after the second HTML item that contained the close span. The first two HTML item will still need to be in the left and right of the value prompt object. The script looks like:




Related documents:

The following knowledge base articles describe additional methods of modifying the formWarpRequest to access the same objects in Cognos 8.3.

1013968 - Javascript: Changing the First Line of a Value Prompt or DropDownList prompt.

1036117 - JavaScript: Sample to automatically select first item in value prompt

Upgrading Javascript Applications to IBM Cognos 8.3/8.4
http://support.cognos.com/en/support/diagnostics/pdf/upgrading_javascript_applications.pdf

Keywords:

8.3 Script Value Prompt Title Default Selection Java

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8345941/viewspace-1056021/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/8345941/viewspace-1056021/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值