3 Replies Latest reply on Jan 30, 2017 12:53 PM by Tracey Kuthol

    Embedcode export to pdf

    Tracey Kuthol

      I am embed javascript code in my page.

       

      <script type='text/javascript' src='https://reports/javascripts/api/viz_v1.js'></script><div class='tableauPlaceholder' style='width: 1004px; height: 1036px;'><object class='tableauViz' width='1004' height='1036' style='display:none;'><param name='host_url' value='https%3A%2F%2Freports' /> <param name='site_root' value='&#47;t&#47;testsite' /><param name='name' value='ExecutiveSales&#47;ExecutiveSales' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='showShareOptions' value='true' /></object></div>

       

      I can able to view reports inside my div.  when i call below function

       

      viz.showExportPDFDialog();

       

      vis is not an  object defined.  is there is problem with javascript embed or missing any object reference or is this function only work in directly creating javascript object on the page

       

      Thanks

        • 1. Re: Embedcode export to pdf

          Hey Tracey,

           

          Have you tried aligning your code with our sample exporttopdf code?

           

          Export to PDF

          1 of 1 people found this helpful
          • 2. Re: Embedcode export to pdf
            Tracey Kuthol

            Thanks for your response.  I changed  to javascript but i am getting 'tableau' is undefined.

            <script src="https:// .... /javascripts/api/tableau-2.js" type="text/javascript"></script>

            <div id="tablet" class=".visible-sm, hidden-sm"><script type="text/javascript">

                                                            var viz;

                                                            function initializeViz() {

                                                                var placeholderDiv = document.getElementById("tablet");

                                                                var url = "@Html.Raw(crcvm.TabletText)";

                                                                var options = {

                                                                    width: placeholderDiv.offsetWidth,

                                                                    height: placeholderDiv.offsetHeight,

                                                                    hideTabs: true,

                                                                    hideToolbar: true

                                                                };

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

                                                            }

             

                                                            </script></div>

            • 3. Re: Embedcode export to pdf
              Tracey Kuthol

              additional information

              <script type="text/javascript">

                      jQuery(document).ready(function ($) {

                          $(initializeViz);

                  })});

              </script>