Hello,
Can anyone tell me how to get the current user and date who is executing some report in ARIS..?
Regards
Hello,
Can anyone tell me how to get the current user and date who is executing some report in ARIS..?
Regards
ARIS Script Help ( [F1] in the Code Script Editor ) would have told you faster:
ArisData.getActiveUser().Name(nLocale)
For the current date there are two possibilites:
OutputField(Constants.FIELD_DATE,... ) and OutputField(Constants.FIELD_TIME,...)
or the javascript (not ARIS Script) object
var date = new Date()
Other inspiring sources are the off the shelf report script "output model information" and the common script libraries atsallen.js and commonUtils.js
In macro's it's quite different to retrieve the current user. Here you should use the following construction:
var oModels = Context.getSelectedModels(); // This can be any context of a macro var oDB = Context.getLoginInfo(oModels[0]).getDatabase(); var sUser= Context.getLoginInfo(oModels[0]).getUserName();
Cheers,
Edwin
Hi,
Construction var date = new Date() works , but format of date/ time is not properly for me.
Can anyone tell me how to get current date/time in format YYYY-MM-DD / HH:MM.
I need to get raport execution date/time and put it into the header of output file.
I try to solve the problem by use JavaScript methods, for example like that:
var current_date = new Date();
var current_date_str = current_date.getFullYear() + "-" + current_date.getMonth() + "-" + current_date.getDate();
But maybe exist easier wat to do it by use ARIS script methods...