COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: andy_mason_84 on 28 Oct 2015 05:41:49 AM

Title: Google Maps Script Won't Load - google undefined
Post by: andy_mason_84 on 28 Oct 2015 05:41:49 AM
Hi All,

We have a Cognos report that has a: -

Prompt Page - Several Prompts on, nothing special

Cognos Map Page: Uses the Cognos UK Map to show Value - this is drill enabled so the user can click on a County and then it takes them to ...

Google Map Page: Loads a Google Map, Centred on the selected County and adds the markers at various location.

Now when I run it without making any selections on the prompt page (i.e all the data) it all works fine.  It also works fine if I select just a few selections on the prompt page.

However if I make a lot of selections on the prompt page, say I 'Select All' on all prompts then when I drill through from Cognos Map (which loads fine) to Google Map I get a 'google undefined' error where it hasn't loaded the google script.  As if because of the complexity of the SQL it is generating in the query is somehow impacting it's ability to load the script?

Has anyone else had issues like this and have any advice or is there anyone out there that knows what is going on?

Thanks,

Andy
Title: Re: Google Maps Script Won't Load - google undefined
Post by: bdbits on 30 Oct 2015 09:12:48 AM
It could be a timing problem, if making these selections slows the response time of the report. Basically, you need your script to be sure it runs after the data has been returned. To see if this is the problem, trigger your Google Maps scripts with a setTimeout() with a long enough delay that the rest of the report has finished.
Title: Re: Google Maps Script Won't Load - google undefined
Post by: andy_mason_84 on 30 Oct 2015 10:49:44 AM
Hi,

Thanks for the reply.  We have set the timeout to be a number of different values and it doesn't seem to make a difference.  That's what we thought it was initially but that doesn't seem to be the problem.

Any more ideas? :)

Cheers.
Title: Re: Google Maps Script Won't Load - google undefined
Post by: bdbits on 02 Nov 2015 09:08:58 AM
Hmmm... are you embedding the script in the page and allowing it to run inline, or is it linked to some event, and if so which one? What if you set it up to trigger the code to run from a button? If it is embedded, is it at the very bottom of the page?

These may seem like elementary things if you've done much javascript, but since I do not know I had to ask. This might also give me time to think up some other idea. :)