COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Ammus1234 on 05 Jun 2015 09:22:54 AM

Title: Set value to tree prompt
Post by: Ammus1234 on 05 Jun 2015 09:22:54 AM
Hello All,

Version: C 10.2.1 FP4

I want to set a value for tree prompt based on some other prompt value.
I am trying to achieve it using Prompt API.

But I could not achieve it for tree prompt, even though it works for value prompt.

I tried with the below script. I am getting use value of prompt 'tree' and trying to set the value for 'tree1'

<script>
var acme = {};
acme.getControl = function(promptName)
{
  var ocr = cognos.Report.getReport("_THIS_");
  return ocr.prompt.getControlByName(promptName);
};

acme.settree= function () {
var t1=acme.getControl('tree').getValues()[0].use;
var  set1= [{'use': t1}];
acme.getControl('tree1').setValues(t1);

    };

</script>

Can somebody please help?