Skip to main content

Hi guys,

 

I want to generate PDF of dashboard and want to sent it through email to related users on scheduled basis.

how to perform it ? PDF should be based on mapping means if an user belong to North region the report should

contain data of north region only.

 

Regards

Inder

3 respuestas
  1. 7 ene 2019, 15:05

    I found it easier to use PowerShell. Try the following

    https://interworks.com/blog/tladd/2013/08/22/automated-pdf-email-distribution-tableau-views-using-powershell-and-tabcmd/

     

    You will need the url where, the Dashboard is located and login details to access the view. Make sure you write the powershell script on the drive where tbcmd is located. I used Outlook as my mail program. The following example might get you started;

     

    $ErrorActionPreference = "Stop"

    #$csvfile = import-csv -path "C:\AutoTemp\users.csv" You can use this line to get a list of email addresses

    $csvfile = import-csv -path "C:\AutoTemp\Tests\pwd.txt"

     

    tabcmd login -s http://address:8000 -u partaddress.local\loginUserName -p password

     

    ⌗Creates the pdf

    tabcmd get "/views/DashboardAddress" -f "C:\AutoTemp\Tests\pass1.pdf"

     

    $smtp = new-object Net.Mail.SmtpClient("10.100.0.30")

    $smtp.Credentials = New-Object System.Net.NetworkCredential;

    $smtp.Timeout = 1000000

    $msg = new-object Net.Mail.MailMessage

     

    $attach = new-object Net.Mail.Attachment("C:\AutoTemp\Tests\pass1.pdf")

        

    #Message from

    $msg.From = "a.ab@hotmail.co.uk"

     

    # Message to

    $msg.To.Add("n.g@outlook.com")

         

    $msg.Attachments.add($attach)

     

    $msg.subject = "Get your pdf"

    $msg.body = "This is your start"

                       

    $smtp.Send($msg)

    $msg.Dispose()

0/9000