COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: AlexisMolina on 29 Nov 2016 01:57:13 PM

Title: Setting Dynamic Date Prompt Values (Cognos 11 R4)
Post by: AlexisMolina on 29 Nov 2016 01:57:13 PM
Hello People, I have a Problem  :'(

In the previous version I used this code to get a date or whatever is by default:

var oCR = cognos.Report.getReport("_THIS_");
var oP = oCR.prompt.getControlByName("date");
var allValues = oP.getValues(true);
var firstValue = allValues[2];
oValues = [firstValue];
oP.setValues(oValues);
setTimeout("promptButtonFinish();",1000);

but in Cognos 11 R4 this not work (I need to use "interactivity mode"),
How can I use this in a custom control?.  Some clue?  I would appreciate it very much if you help me.
Title: Re: Setting Dynamic Date Prompt Values (Cognos 11 R4)
Post by: AlexisMolina on 30 Nov 2016 08:35:32 AM
define( function() {

function PageModule()
{};
PageModule.prototype.load = function( oPage )
{
   console.log( "PageModule.load" );
};
PageModule.prototype.show = function( oPage )
{
   console.log( "PageModule.show" );
   var oControl = oPage.getControlByName("fechaHasta");
   console.log( oControl ? "found control" : "control not found" );
   oControl.addValues( [oControl.getValues( true )[2]] );
   //oControl.addValues ( [JSON.parse('{"use":""}')] );
};

return PageModule;
});



I use this but it does not work... help¿?