COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: stutib on 30 Aug 2023 10:42:00 AM

Title: Date time prompt by default dynamically set to UTC time zone
Post by: stutib on 30 Aug 2023 10:42:00 AM
Hello Cognos masters!

Is it possible to have a date time prompt dynamically set to UTC time zone irrespective from where users is running the report?

I have accomplished this using JavaScript in HTML Item when I am running the report when Run with full interactivity is "off".

I need this to work when we running the report with full interactivity,I try to create JavaScript to use with custom control but it's not working

define( function() {

"use strict";

function DefaultDateSelection(){
};
DefaultDateSelection.prototype.load = function( oPage )
{

var EDateTime = new Date();
EDateTime.setDate(EDateTime.getUTCDate());
var FromDate= EDateTime.getUTCDate();
var pickerControlObject = oPage.getControlByName( "PDateTime" )
pickerControlObject.setValues([{use: EDateTime.toISOString()}]);;
};


return DefaultDateSelection;
});



Any help would be greatly appreciated.
Title: Re: Date time prompt by default dynamically set to UTC time zone
Post by: dougp on 31 Aug 2023 09:54:43 AM
One option is to use JavaScript:  https://public.dhe.ibm.com/software/data/sw-library/cognos/mobile/scriptable_reports/index.html