私はレポートで jQuery を使用しており、jQuery のおかげですべてが一度に読み込まれる一連のレポートがあるため、顧客はクリックごとに待つ必要がないため、移行がより高速であると感じています。顧客が使用するプロンプトに基づいて、すべてのレポートを変更できるようにしたいと考えています。したがって、特定の日を選択すると、スイート内のすべてのレポートがその日に変更されます。または、選択した特定の領域がある場合は、すべてのレポートがその領域に移動します。これにより、顧客は各レポートのプロンプトでパラメータをロードする必要がなくなります。これを行う方法があるかどうかは疑問です。私は見ましたが、何も見つかりませんでした。
編集..したがって、すべての iframe と、changeMonth という名前の値プロンプトを格納するレポートには、この JS があります。
<script>
var report = cognos.Report.getReport("_THIS_");
var radio = report.prompt.getControlByName('monthChange');
var currentRadioValue = radio.getValues()[0]; //Get initial value object
radio.setValidator(validateRadio); //Define function to validate prompt
function validateRadio(values) {
if (values && values.length > 0 && values[0].use != currentRadioValue.use) { //Only do anything if control has value and has changed
currentRadioValue = values[0]; //Assign new value for later comparison
for (var i=0; i<window.frames.length; i++) { //Loop through all iFrames
window.frames[i].changeValue(values[0].use); //Call the changeValue function passing in the radio button value
}
}
return true; //Indicates the prompt is valid
}
</script>
iframe が必要なレポートには、HTML タグにこのコードを含むドロップダウン リストである値プロンプトがあります。
<script>
function changeValue(str){
var report = cognos.Report.getReport("_THIS_"); //Grab a handle for the report
var control = report.prompt.getControlByName('monthChange'); //Grab a handle for the prompt control
control.addValues([{"use":str,"display":str}]); //Change the prompt to the passed in value
report.sendRequest(cognos.Report.Action.REPROMPT); //Reprompt the page
}
</script>
それが重要な場合、それらは両方ともドロップダウンリストでした。それらをラジオボタンとしてリストしたことがわかりましたので、ここですぐにそれを試してみて、何か変化があったかどうかをお知らせします. しかし、どのようにセットアップしたのですか、他にやるべきことはありますか?