Generate pdf file of Tableau View
- Go to Tableau Server machine, open Command Prompt with administrative rights
- On Command Prompt, navigate to Tableau Server bin directory by typing the below command
cd C:\Program Files\Tableau\Tableau Server\<version>\bin
(or)
cd C:\ Program Files (x86)\Tableau\Tableau Server\<version>\bin
- Login to Tableau Server using below command
tabcmd login -s http ://<host>:<port> -u
<username> -p <password>
You can see some status message after running the above command.
- Now, type the below command to generate pdf file of Tableau view
ex: tabcmd get
"/views/Dashboard-SalesProfits/Dashboard2" -f "C:\tmp_Folder\dashboard22.pdf"
Email
the generated pdf file as an attachment
First of all, download and install “febootimail” command line email
sending utility from http://www.febooti.com/
website.- On Command Prompt, navigate to “feebootimail” installation path
cd C:\Program Files (x86)\Febooti Command line email
febootimail -SMTP <your-mail-smtp> -PORT
<port-number> -TO "<email-1; email-2>" -FROM
<email-from-id> -SUBJECT "email subject line" -ATTACH
"<path-of-generated-pdf-file>" -BODY "email message"
ex: febootimail -SMTP mail.infinysis.com -PORT 25 -TO
"naga.allaboutbi@gmail.com" -FROM naga.k@infinysis.com -SUBJECT
"Tableau View - PDF format " -HTML -TEXT "Hi, <br/> Please
find the attached file for Tableau view in pdf format. <br /><br />
http://localhost:8000/ " -Attach "c:\tmp_Folder\dashboard22.pdf"
-AUTH LOGIN -USER naga.k@infinysis.com -PASS *******
Additionally, you can put the entire script in a BATCH file
and schedule it using windows task scheduler.
Find the complete script below.
Happy coding!!!
No comments:
Post a Comment