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.
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.
This is great! Can you elaborate a bit on where to run this code from? Where can I find “the top frame in the console”? Thanks!!
The console I’m referring to is in the browser’s developer toolbar. In IE, Chrome, and Firefox you can press the F12 button to open the dev toolbar. In Chrome you’ll see Elements, Console, Sources, Network and a few others. In this case you’ll want the Console tab. On the upper left you’ll see a dropdown that says “Top” if you click on that you’ll see the individual frames in the browser. Each report sits in it’s own. The code that I wrote is specifically designed to work on the Top frame.
I’m glad to see someone else getting an error like this. Paul, we have some reports in SharePoint on the cloud published where we embed the user id and pw in the URL. The reports work the first time and if they decide to run another report they get this error. It seems like the cache retains the login/pw and get the error. The user needs to log out of their internet connection and restart the connection to run the next report. We spoke to IBM and they know this is an issues with SharePoint on the cloud. We don’t have this issue with SharePoint on-prem. Any suggestion on how to resolve this?
I really wish I did have some suggestions. It sounds like there’s a cookie being invalidated somewhere when it gets the credentials again. Maybe set up a two step process for your users, they have to run a “log-in” report that has the userid and pw, and then the individual report links wouldn’t have the credentials?