分享至上,xiaof为你讲述cognos组件的定制开发
在“【cognos客制化】定制cognos组件”这篇概述性文章之后,有朋友想了解具体过程,我在下文就详细讲讲开发过程:)具体过程难以言尽,希望对大家有所帮助~
定制搜索框 step by step
1. 通过js从text prompt 中获取val_#值,然后将其放在value prompt中显示
2. 与此同时,将val_#值添加到隐藏的text prompt组中,起到缓存的作用
3. 之后将val_#中的值作为filter筛选条件添加到query中去
Step one and step two, fetch data and insert it to self-made cache
function addOption(Name) {
//get the cognos contorl item
var tName = "_t" + Name;
var vName = "_v" + Name;
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
if ( !fW || fW == undefined) { fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );}
var valueLength = 3;
var textComponent = eval("fW._textEditBox" + tName);
var valueComponent = eval("fW._oLstChoices" + vName);
valueComponent.options.add(new Option(textComponent.value, textComponent.value));
var valueNum = valueComponent.options.length;
for (var fi = valueNum; fi < valueLength+1; fi++)
{
var subTextComponent = eval("fW._textEditBox" + tName + fi);
subTextComponent.value = textComponent.value;
}
}
Step three, add query to filter data
(upper([REPORT_MANAGER_NOTES_ID]) contains upper(?P_Manager1?))
or (upper([REPORT_MANAGER_NOTES_ID]) contains upper(?P_Manager2?))
or (upper([REPORT_MANAGER_NOTES_ID]) contains upper(?P_Manager3?))
以上均为原创且经过实践,保留一切权利。