------需求:
改变下拉列表中的名称显示。
------解决方案:
增加以下javascript到report studio
if (fW)
{
fW._oLstChoicesPromptName.options[0].text = '写入你想显示的名称';
fW._oLstChoicesPromptName.focus();
fW._oLstChoicesPromptName.blur();
}
}
setTimeout("setDefaultValue()", 10);
------完整英文版解决方案:
Title:
Javascript: Changing the First Line of a Value Prompt or DropDownList prompt.
Document#:
1013968.7
Updated:
Dec 04, 2008
Applies To:
Cognos 8 BI Report Studio 8.1 | Cognos 8 BI Report Studio 8.2 | Cognos 8 BI Report Studio 8.3 | Cognos ReportNet 1.1 | Cognos ReportNet 1.1MR1 | Cognos ReportNet 1.1MR2 | Cognos ReportNet 1.1MR3
SRs:
46
Collection:
KB
--------------------------------------------------------------------------------
Note: This technique uses JavaScript against underlying report objects and methods in an IBM 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.
Multimedia:
There is a video for versions prior to IBM Cognos 8.3 on this topic in the Multimedia Knowledge Base.
Description:
If you use a value prompt in your report, the label for the first line in the drop down list is the name of the Query item which is used to populate the prompt. How can this label be changed?
Solution:
Add an HTML item to the bottom of the report page. Add the following JavaScript code block(s) to the HTMLItem to change the first line of the drop down list.
Steps:
1. Go to the page that contains the value prompt and select the value prompt.
2. Specify a unique reference ID, such as UID for the last property in the list.
Note: In IBM Cognos 8, UID is now referenced as PromptName, replace PromptName with your refererence in the code fragments.
3. Add an HTML item to the bottom of the page, or right after the Prompt Control.
4. Insert the following JavaScript code into the HTML item:
For IBM Cognos 8.1 and 8.2 use this code fragment :
For IBM Cognos 8.3 use this code fragment :
Keywords:
JavaScript ReportNet CRN C8
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8345941/viewspace-1056023/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8345941/viewspace-1056023/