Automate PDF or Image Download from Tableau Server or Tableau Online

Blog | November 28, 2018 | By Honey Shahi

Automate PDF or Image Download from Tableau Server or Tableau Online: A Complete Guide

Streamline Your Reporting: Automating PDF or Image Downloads from Tableau Server

Enhance Your Workflow: Step-by-Step Instructions for Automating Downloads in Tableau

Although technology the world over has developed exponentially, and we’ve got newer and better ways of understanding our data thanks to today’s dashboard visualization capabilities – there is still a huge part of senior business officials out there that prefer to view images in PowerPoint Presentation as a method of presentation. 

In this blog, I am going to explain one of the key issues which almost every Tableau developer faces from clients. It should be noted that these, ‘clients’ are not developers of Tableau dashboards per se but are more so ‘consumers of the results’ which the dashboard provides them with. Most of these users subscribe to emails that show them either PDF Format (image) or PNG Format of the dashboards, on a timely basis.

Why Automate Downloads? Understanding the Benefits for Tableau Users

Setting Up Automation: Detailed Instructions for PDF and Image Downloads

Advanced Techniques: Customizing Download Settings for Your Specific Needs

Optimizing Reporting: Tips and Tricks for Efficient Workflow Automation

Download Tableau Dashboard as PDF

Tableau has a feature where users can download dashboards in PDF (image) and PNG formats.  This is a great functionality for users to leverage, but what happens if we need to download five PDF files for five different Filter values or fifteen different values, or selected sheets of a dashboard? 

Long story short – we’ll have to filter our Tableau dashboard four times and then proceed to download the PDF Images separately – costing us more time, energy, and resources, it’s simply not a feasible option.

Automation: Download Tableau Dashboard as PDF Option  

To solve our problem we will be applying a solution that automatically downloads separate files for separate filters without users having to do the same manually and repeatedly. For this solution, I will be using tabcmd command provided by Tableau.

Tableau provides the tabcmd command-line utility which users can use to automate site administration tasks on the Tableau Server site or Tableau Online. For example, creating or deleting users, projects, and groups. 

The prerequisites for successfully implementing this solution are: –

·       Install tabcmd on your computer

·       Install tableau server

Link to both are Tableau server and tabcmd

  • Make sure you have Tableau Online log in credentials 
  • Make sure the version for both tabcmd and Tableau Online are the same. E.g. in the snapshot of my local system below, I have the Server version as 10.5 and my Tableau Online version is 10.5 – so I’ve installed tabcmd from the link above with the same version. 
  • Ensure that you have your local system admin rights if you are working for an organization. 

Problem :

Below is a snapshot of a dashboard with Filter Name “Ship Mode” which has more than one filter value. The user needs to download 5 different PDF/Image(PNG) files for each filter ((All), First Class, Same Day, Second Class, Standard Class) without doing it manually. 

The sample URL and dashboard I am using is in this blog below. 

https://10ay.online.tableau.com/#/site/****/views/Superstore/Shipping?:iid=7


Note: This solution works for both Tableau Server or Tableau Online dashboards. In this example, I will be demonstrating the solution using a dashboard published on Tableau Online

Step 1

  • First Check if tabcmd, Tableau Server is installed and the organization has Tableau Online. 
  • You will need Tableau Online credentials. 

Note: For Dashboards published on Tableau Server  

If you have Tableau Server installed on your local device you can directly execute the script in command prompt without installing tabcmd. If you are using a shared server and the server is not installed on your local device then you will need to install tabcmd onto your local device.  

(Tabcmd can be found on your computer in the location C:\Program Files\Tableau\Tableau Server\10.5\extras\Command Line Utility.) 

Step 2 

  • Once you’ve installed everything, proceed to open a new notepad file. 
  • Enter the filter values in the notepad file.
  • Be careful, since values are case sensitive – make sure you copy every value exactly as is shown in the filter dropdown. 
  • Make sure each filter value in the notepad is in a new line.  
  • Now, save it as filter.txt.  
  • See the snapshot below. 

I have used %%20 as there is space between the filter values. Replace each space with %%20. 

Step 3

  • Open a new notepad file.  
  • Copy the script below in the notepad file and save the file as .bat (Windows batch file).  
  • Once copied delete the texts in blue color. 

Note: Make sure to save both notepad .txt and .bat file (batch file)in the location where tabcmd is installed i.e., C:\Program Files\Tableau\Tableau Server\10.5\extras\Command Line Utility. 

  • You will not need to do this step if you are directly using command prompt, considering you have Tableau Server installed on your local machine. 

Note:  

  • All the texts in red have to be customized as per user details and requirements. See their description in parenthesis.
  • Ship%%20Mode here %%20 is used as there is space between Ship and Mode. Make sure to put %%20 wherever there is space between texts. 
  • Sometimes the filter name in the desktop version would be different than what’s used in the server (for better understanding of user). So, make sure the name used in the code is the same as the one used in Version, not Server. See the snapshot below.  

Step 4 

  • Run the .bat file saved in the location where tabcmd is installed.
  • The PDF or PNG file would be saved in the local machine. This method can be customized to download PDF and PNG files for many different sets of filters.

See below the snapshot for the execution of the script and the sample PDF and Image file. 

I hope you liked the solution. Let me know your feedback in the comments section.

Benefits of Automating Downloads: Improving Efficiency and Productivity in Tableau

Step-by-Step Guide: Configuring Automated Downloads for Your Tableau Server or Online Instance

Customization Options: Tailoring Download Settings to Your Reporting Requirements

Best Practices: Maximizing the Impact of Automated PDF and Image Downloads in Tableau

Improvisations/Next Steps: 

Using Scheduler to fully automate the download of the resulting PDF File and further use Power Shell to Encrypt the username and password for highly confidential market areas. 

Credits: – Tableau Community and Tridant

Honey Shahi
About the Author
Honey Shahi