Export Tableau Dashboards to PDF Using Tabcmd

Tabcmd is a powerful tool, allowing a Tableau Server or Tableau user to do many things, such as create sites and users via a command line interface (CLI).

Using tabcmd export, users can export Tableau dashboards, views, workbooks, and data to PDF, CSV or PNG.

Downloading and Installing tabcmd

tabcmd is installed by default on Tableau Server, but you can install tabcmd on any host. In this blog we will exclusively be on using tabcmd on Ubuntu 18.04.

You can download any version of tabcmd directly from Tableau's releases page for Tableau Server. In the example below, we use wget to download the tabcmd debian package.

cd /tmp
wget https://downloads.tableau.com/esdalt/2018.3.3/tableau-tabcmd-2018-3-3_all.deb

Change the version above to the version of your Tableau Server/Online.

Next we install tabcmd using dpkg and delete the debian package.

sudo dpkg -i /tmp/tableau-tabcmd-2018-3-3_all.deb
rm /tmp/tableau-tabcmd-2018-3-3_all.deb

You will have to exit and reconnect to your host after installation to get tabcmd in your $PATH. Ensure it's there with which tabcmd. Once installed accept the EULA with: tabcmd version --accepteula

For the export to work you will also need the java runtime installed: sudo apt-get install openjdk-8.jre-headless

Using Tabcmd to Export Tableau Dashboards as a PDF

To see a help page for tabcmd export with command and global flags use: tabcmd help export.

On our Tableau sever we have an example workbook:

Sample Workbook From Tableau Demo

In this example we have the view IncomeStatement in the IncomeStatement workbook. It has a URL similar to this: <server_name>/#/views/IncomeStatement/IncomeStatement

The part of the URL we need is "IncomeStatement/IncomeStatement".

NOTE: Even if you're exporting every view in the workbook (using --fullpdf) you will need to include a view in the Tabcmd command. More on that below.

Example Export Tabcmd Command

tabcmd export 'IncomeStatement/IncomeStatement' --fullpdf --pagelayout landscape --pagesize letter -f '/home/ubuntu/year_to_date_full.pdf' -s 'https://<server_name>' -t <site_name> -u '<username>' -p '<password>'

This will create a PDF document with the view in landscape, on a standard letter page size. It will output to a file named: /home/ubuntu/year_to_date_full.pdf.

As our workbook only has one view, --fullpdf will output a one page pdf of our view. We could have also used --pdf to get the same results, however, if the workbook has more than one view --pdf will only export the view given. In that case --fullpdf would have multiple pages, with a different view on each page. Alternatively, You can also output as CSV, and PNG respectively with --csv and --png.

If you are not using a site you can omit  -t <site_name>.

If you're running the export command from your Tableau server you will not need to include server (-s), username (-u), and password (-p) flags.

Final PDF

Visit here for a complete list of commands you can use with the tabcmd command line tool.

Make administering Tableau a breeze with the following resources from Zuar:


> With Zuar's Portal, you can provide branded Tableau dashboards to monetize your data, or provide secure access outside of corporate firewalls.

> With the Zuar Runner ELT solution, you can get data flowing from hundreds of potential sources into a single destination, fully prepared for Tableau.

> Zuar's Tableau-certified consultants can take care of all the heavy lifting.

> Check out our tips & tricks for Tableau, including:

How to Embed a Tableau Dashboard in to a Website | Zuar
Here’s how to embed Tableau dashboards with a Tableau embed code, Tableau Javascript API, and iframe + Tableau share link.
How to Hide Filters With Tableau Dashboard Actions | Zuar
See a special technique for hiding Tableau dashboard filters until an action is initiated. View this article for full instructions!
Connecting Tableau to Different Types of Data Sources | Zuar
Tableau provides a variety of connection options for connecting Tableau to data sources. Learn about each option.