Livestream: Bag o’ Tricks and Bag o’ Controls – UPDATED!

On February 13, at 2PM EST, I’ll be guest presenting a live stream with my good friend Ryan Dolley. Ryan will be doing a deep dive on changes (documented and not) in Cognos 11.1.5. I’ll be going over my Bag o’ Tricks extension pack. What it does, why it’s important, and how to use it.

More details here: https://pmsquare.com/events/2020/1/28/livestream-reporting-in-cognos-analytics-1115

Sign up and drop me a line if there’s something specific in the extensions you want me to cover.

UPDATE – It’s gonna happen for real this time! I promise. It’s a YouTube livestream, so it will be saved forever and ever.

Quickie: The user is already authenticated in all available namespaces

Have you ever stepped away from your computer for just a few minutes, and come back to Cognos proudly stating that you’re already logged in? That very useful message preventing you from saving the report that you’ve worked for hours and hours on.

already authenticated

Can you guess what happened to me this morning?

Well, after a few moments of panicking I realized that the reports are still there in the browser. I’m not sure which reports are saved (all of them, right? because I always save when I should), but at least the XML is there waiting for me.

Fortunately, the application JavaScript we need is not obfuscated. So this will work:

for(var i=0;i<frames.length;++i){
if(!frames[i].Application.GlassView) continue;
var gv = frames[i].Application.GlassView
  , saved = gv.isDirty()?'Not Saved':'Saved'
  , name = gv.getTitle()
  , cmProp = gv.cmProperties;

console.log(name + ' is ' + saved)
if(gv.isDirty()&&cmProp){
console.log('In order to save ' + name + ' , type in frames['+i+'].Application.Save() or you can get the report XML by typing frames['+i+'].Application.Document.GetReportXML()')
}
else if(gv.isDirty()&&!cmProp){
console.log('This is an unsaved report so a simple save action will not work. You can retrieve the report xml by typing frames['+i+'].Application.Document.GetReportXML()')
}
}

Run that from the top frame in the console and follow the instructions for each report.

Now a colleague did mention that sometimes pressing the back button will resolve it, but it doesn’t always work for me and I’m super paranoid about losing work.