I wanted to embed tableau report in the app. Therefore i created an app with html template. In the properties -> custom html section i pasted the following lines
<center style="font-style:italic; color:#888; margin: 3em;">
Tableau Report Should be displayed here
<div id="vizContainer">
</div>
</center>
<script>
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.onload = function() {
}
script.type = 'text/javascript';
script.src = 'https://public.tableau.com/javascripts/api/tableau-2.min.js';
head.appendChild(script);
function displaytableau()
{
var placeholderDiv = document.getElementById("vizContainer");
var url = "https://public.tableau.com/views/WorldIndicators/GDPpercapita";
var options = {
width: "800px",
height: "550px",
hideTabs:true,
hideToolbar: true,
};
// $(intializeViz);
var viz = new tableau.Viz(placeholderDiv, url, options);
}
function showJsAlert(message) {
alert(message);
return 42;
}
</script>
when the app is run I got the following error
ExternalError: TypeError: tableau.Viz is not a constructor at [Form1, line 17](javascript:void(0))
Can you please let us know the issue and how to fix this.