1 Reply Latest reply on Jul 28, 2016 12:19 AM by Glen Robinson

    Need to do Subscription for PDF format for a view for each individual user based on there privilages

    AJ AJ

      Hi

       

      Can some one help me on this , I Need to do Subscription for a PDF format of a view/Dashboard for each individual user based on there privilages. I dont have a parameter for each individual users to select that in the tabcmd get command to pass as parameter.

       

       

      :: run tabcmd get command which retrieves the URL of the reports with the filter and size parameter

      :: reports are saved to pdf

      tabcmd get "views/workbook/report1.pdf?param=value&:size=1680,1050" -f "C:\report1.pdf"

      tabcmd get "views/workbook/report2.pdf?param=value&:size=1680,1050" -f "C:\report2.pdf"

       

      Can you please let me know if i can achieve this or not.

        • 1. Re: Need to do Subscription for PDF format for a view for each individual user based on there privilages
          Glen Robinson

          Hi AJ

          From your question, i'm not 100% sure what you are after, but can show you how you can get individually filtered reports using the tabcmd.

           

          Firstly, I put the information that we want to filter in a CSV file, so that we have something like

           

          Manager,Region

          Archie,South

          Bob,East

          Charlie,West

          Dave,North

           

          The CSV file (called Managers.csv) holds the Managers Name, and the Region they want the report to be filtered on

           

          Then I use a simple powershell script to loop through the CSV file to tabcmd the individual Manager's report.

           

          Something like this:

           

          $csvfile = import-csv -path "managers.csv"

           

          $server = "https://tableauserver.company.com"

          $username = "admin"

          $password = "password"

          $TempFolder = "D:\temp\"

          $tabcmd = "D:\Program Files\Tableau\Tableau Server\9.3\bin\tabcmd.exe"

          $URL = "views/workbook/report1"

           

          foreach ($line in $csvfile)

          {

            $manager = $line.Manager

            $Region = $line.Region

            $FileName = $TempFolder + $manager + ".pdf"

            $FullURL = $URL + "?Region="+ $Region

            & $tabcmd get -s $server -u $username -p $password  $URLPath -f $FileName

          }

          & $tabcmd logout

           

          If you take the above script, change the variables (csvfile, server, username, password, tempfolder, tabcmd, URL) to make them specific to your environment, and save to a file (say GenerateReport.ps1). You can then run in powershell , which is installed by default on all Windows PCs.

          You get 4 different reports (archie.pdf, bob,pdf, etc), which are filtered to the data that is relevant to them

          Then adding a line to email the report to them is pretty straight forward too.

           

          Hope this helps

          Glen