6 Replies Latest reply on Jan 18, 2013 5:05 AM by Russell Christopher

    How to supply embed filters for initially inactive tabbed worksheets?

    Anya Fishchuk

      Hi!

       

      When embedding the view in a web application, I faced a problem.

       

      The view consists of several tabbed worksheets (say, Sheet1 and Sheet2) .  In the code I have to supply the name of a worksheet (with the only name of the view it is not working). So, I supply parameter "name" with value "<workblock1>/Sheet1".

      When running the code, I can see and select another worksheet Sheet2 by selecting another tab , but the supplied embed filters for Sheet2 are not working. On the one hand, this sounds logical: the embed filters are configured with "not own" Sheet1. From another hand, how  can I configure and let work the embed filters for Sheet2 ( initially inactive worksheet in tabbed view)?

       

      I did not manage to find any related information here.

       

      Thanks in advance!

       

      Best regards,

      Anya

        • 1. Re: How to supply embed filters for initially inactive tabbed worksheets?
          Russell Christopher

          Hi Anya -

           

          Would you mind posting the code you're working with? I think following what you're saying, but not 100% sure.

           

          My knee-**** reaction would be to tell you to set the filters in the second sheet as "global" and just set them as you call the first sheet.

           

          I'm also a bit confused as to whether you are setting filter values or parameter values - you use the words interchangeably.

           

          Thanks!

          • 2. Re: How to supply embed filters for initially inactive tabbed worksheets?
            Anya Fishchuk

            Hi,

            Sorry for confusing description.  I will try now to describe it better,  in steps:

            1.      I create a workblock , containing two worksheets and publish both worksheets with selected “Show Sheets as Tabs”

            SaveWorkbook.jpg

              2. Then I add the following code in my web application :

            <script type="text/javascript" src="http://bxtv199d74/javascripts/api/viz_v1.js">

            <object class="tableauViz" width="629" height="602" style="display:none;">

                <param name="host_url" value="http%3A%2F%2Fbxtv199d74%2F" />

                <param name="site_root" value="" />

                <param name="name" value="Anya_CRIS4U_vwRelease/Sheet1" />

                <param name="tabs" value="yes" />

                <param name="toolbar" value="yes" />

                  <%-- embed filter for Sheet1 --%>

                <param name="filter" value="ApplicationID=2,8,20" />

                 <%-- embed filter for Sheet2 --%>

              <%-- <param name="filter" value="Booking Entity=Italy (B)" runat="server" /> --%>

               </object>

            </script>

             

            In this code there is only possibility to add an embed filter to Sheet1, not to Sheet2.

            What we actually would like is to add a (different!) embed filter to the Sheet2

            3. I run the web application and see the expected filtered sheet 1:

            Webpage1.jpg

            4. When I switch to the Sheet2, I have a possibility to see only unfiltered data. Is it any possibility to add an embed filter to the Sheet2?

             

            We want to filter data on the client site (in the web application), and every worksheet would use a different embed filter, so a global filter is not a best option.

             

            I hope that this time it is more clear.

             

            Thanks!

             

            Best regards,

            Anya

            • 3. Re: How to supply embed filters for initially inactive tabbed worksheets?
              Anya Fishchuk

              Good morning!

               

              Just as addition to the message here above, what we actually want is to apply the embed filter

              <param name="filter" value="ApplicationID=2,8,20" /> to the Sheet1 , and the embed filter <param name="filter" value="Booking Entity=Italy (B)" runat="server" /> to the Sheet2.

              Best regards,

              Anya

              • 4. Re: How to supply embed filters for initially inactive tabbed worksheets?
                Russell Christopher

                Hi Anya -

                 

                It may be helpful to understand what's going on under the covers here:

                 

                • Based on the parameters in your object class, we build a string which essentially calls the report: http://machine/Anya_CRIS4U_vwRelease/Sheet1?ApplicationID=2,8,20&<some other stuff you don't care about>

                 

                ...So you can see the problem. The call is addressing a specific sheet. There is no way to say "Hey, render sheet 1 with values xyz, and also render sheet 2 with values 5,6,7" -- because we can't "talk" directly to sheet 2.

                 

                What we CAN do is talk indirectly to sheet 2, however. What you're hoping to do is set the "Booking Entity" filter for sheet 2. We already know you can't directly set the value of that filter specifically on sheet 2 while we talk to sheet 1. BUT - if you make "Booking Entity" a Global Filter, it impacts *all* worksheets that use the same data source.

                 

                Essentially, make "Booking Entity" a Global Filter, and then set it's value when rendering Sheet1 - By doing so, the value will already be set when you switch to Sheet2. This idea assumes that filtering the resultset down to "Italy" won't adversely impact what we're looking at in Sheet1.

                 

                ..and the good news is this all becomes much easier in Tableau Server 8 - the improved JavaScript API will let you do lots of wonderful things that you can't even consider doing now in version 7.

                 

                Hope this helps?

                • 5. Re: How to supply embed filters for initially inactive tabbed worksheets?
                  Anya Fishchuk

                  Dear Russell,

                  Thanks for your detailed answer.

                  It is something I was already afraid of....

                  We would like to set the filter on the client side, so not as a global filter.

                  So probably we will just implement tabs ourself, in the code.

                   

                  And let's wait till the new release. I am curious.

                   

                  Best regards!

                  Anya

                  • 6. Re: How to supply embed filters for initially inactive tabbed worksheets?
                    Russell Christopher

                    Any filter values you set are user and session specific - you are not setting them for everyone who views the report. No worries there.