2 Replies Latest reply on Aug 2, 2018 4:00 PM by Luke Gillett

    Embedding Tableau sheet in Web page not working despite using ?:embed=yes

    Luke Gillett

      Hi,

      I'm using sample code found online as per below.

       

      I've tried

      • with and without the /t/.
      • embed=y, embed=yes, embed=true
      • with javascript and without (as per the iframe below)

       

      The error is "Refused to display XXXXXXX in a frame because it set 'X-Frame-Options' to 'sameorigin'. Which points to the clickjack protection. Asking to have this removed would lower security and the embed seems to work for others online.

       

      Does anyone have any idea what I am doing wrong here?

       

      <html>

      <head>

          <title>Basic Embed</title>

         

          <script type="text/javascript"

                src="http://SERVER/javascripts/api/tableau-2.0.0.min.js"></script>

          <script type="text/javascript">

              function initViz() {

                  var containerDiv = document.getElementById("vizContainer"),

                      url = "http://SERVER/t/site/Business_Intelligence/views/WORKBOOK/WORKSHEET?:embed=yes",

                      options = {

                          hideTabs: true,

                          onFirstInteractive: function () {

                              console.log("Run this code when the viz has finished loading.");

                          }

                      };

                 

                  var viz = new tableau.Viz(containerDiv, url, options);

                  // Create a viz object and embed it in the container div.

              }

          </script>

      </head>

       

       

      <body onload="initViz();">

          <div id="vizContainer" style="width:800px; height:700px;"></div>

           <iframe src="http://SERVER/t/site/Business_Intelligence/views/WORKBOOK/WORKSHEET?:embed=yes&:tabs=yes&:toolbar=yes" width="800" height="600"></iframe>

      </body>

       

       

      </html>