Link to home
Start Free TrialLog in
Avatar of Mik Mak
Mik Mak

asked on

Embed Google Chart in MS Access

I'm trying to embed a Google Chart in MS Access 2010/13/16, via a web browser AxtiveX linked to a local html file - contents shown below. But I only get an empty white page. Any ideas would be most welcome :)

content_copy
<html>
  <head>
    <script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type='text/javascript'>
     google.charts.load('current', {'packages': ['geochart']});
     google.charts.setOnLoadCallback(drawMarkersMap);

      function drawMarkersMap() {
      var data = google.visualization.arrayToDataTable([
        ['City',   'Population', 'Area'],
        ['Rome',      2761477,    1285.31],
        ['Milan',     1324110,    181.76],
        ['Naples',    959574,     117.27],
        ['Turin',     907563,     130.17],
        ['Palermo',   655875,     158.9],
        ['Genoa',     607906,     243.60],
        ['Bologna',   380181,     140.7],
        ['Florence',  371282,     102.41],
        ['Fiumicino', 67370,      213.44],
        ['Anzio',     52192,      43.43],
        ['Ciampino',  38262,      11]
      ]);

      var options = {
        region: 'IT',
        displayMode: 'markers',
        colorAxis: {colors: ['green', 'blue']}
      };

      var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
      chart.draw(data, options);
    };
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 900px; height: 500px;"></div>
  </body>
</html>
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Does the page display correctly in IE 11?

Jim.
There is a security issue with local html pages. I haven't experienced it myself, but recall reading about it a few times. Try to look into the "Mark of the web" issue.
A quick google gave me the following link, try to look at that.
http://wiki.helpmvp.com/home/notes/javascript/markoftheweb
Avatar of Mik Mak
Mik Mak

ASKER

@Jim - yes it does

@Anders - I have tried to enable both of theses settings in IE that should control the local html page warning
1)Allow active content to run in files on My Computer
2)Allow Active Content from CDs to run on My Computer
3)"Mark of the web" put in the local html file, but it still only show a blank white page
The other issue can potentially be an invalid cache setting in the registry (that's why I asked about IE11, which is what that active-x control is based on).

If the user can't write to the local cache properly, pages will appear blank.   I had this happen with a client and Bing Maps.    Pages that don't use cache services appear normally.

Jim.
Avatar of Mik Mak

ASKER

It's tested on 3 different machines with Win 7  32/64 bit and IE 11 - Works fine when doubleclicking the local file, but nothing is shown in the embedded Access/browser page
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
BTW, if that works, then it boils down to security settings for Active-x and dovetails into Ander's comment.

Jim.
Avatar of Mik Mak

ASKER

Hi Jim
#1 don't make any difference here when I'm already using the settings mentioned in my previous post. I'll have a go with your #2 suggestion, and report back :)
<<#1 don't make any difference here when I'm already using the settings mentioned in my previous post. I'll have a go with your #2 suggestion, and report back :)>>

 When you open the file directly in IE 11, do you get an active-x warning?

Jim.
Avatar of Mik Mak

ASKER

No warnings in IE11
Avatar of Mik Mak

ASKER

Hmm tried to add the registry keys for my 32bit on 32 bit test machine for MSACCESS.EXE - tried both IE11 settings with no luck.. :)
Avatar of Mik Mak

ASKER

Setting the registry DWord value to 0 makes it work here, together with "Mark of the web" put in the local html file !

The writer on your link mentions it might be a way to Refer to the installed IE version
<<No warnings in IE11>>

Well given that, you should also check that cache registry key then, as it is something else. Key is:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\LowCache\Extensible Cache\DOMStore\CachePath

incorrect entry is:

%USERPROFILE%\AppData\Local\Microsoft\Internet Explorer\DOMStore

correct entry is:

%USERPROFILE%\AppData\LocalLow\Microsoft\Internet Explorer\DOMStore


'LocalLow', not 'local'

There's also a similar key for the medium cache:

KEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Extensible Cache\DOMStore\CachePath

correct value:

%USERPROFILE%\AppData\Local\Microsoft\Internet Explorer\DOMStore

You should not have to change this.

and last, on the cache problem, run the following command from a command line prompt:

icacls %userprofile%\Appdata\LocalLow /t /setintegritylevel (OI)(CI)L

This resets the folder security on the low cache folder.

 I would also add that I did get your file to display, although I did add:

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

 to the file.  I did just re-test though and it still loaded.

Jim.
<<Setting the registry DWord value to 0 makes it work here, together with "Mark of the web" put in the local html file ! >>

 Ignore last comment then, except for the last sentence or two.  You might want to add that markup.  It tells the browser to use the latest version possible.

Jim.
Avatar of Mik Mak

ASKER

Perfect Jim !

I was just testing on another machine with Acc2010 on a 64bit machin, where it didn't Work - but after adding then extra maktup you mentioned it Works great on this machine also :)

Thank you very much for your effort
Avatar of Mik Mak

ASKER

Now I just need to find a way to transfer the data from the database into the map :)
That's another problem, and another question<g>.

Have a good day...

Jim.
Avatar of Mik Mak

ASKER

I know :)

Same to you