Last year I wrote about Tableau Server’s tabcmd feature here. Well just this week, I’ve been working on a solution that leverages tabcmd. The problem is that we need a PDF copy of one dashboard with more than 5000 options on one filter. Our company has over 5000 franchise hotels in the US, so one per property. Luckily, this can be achieved rather painlessly with tabcmd.
The best way to handle this would be to create a batch file that contains all the commands. This is as easy as launching a text editor and saving the file with a .bat extension. Start by login into your server.
tabcmd login -s http://localhost -t site -u username -p p@ssw0rd!
The -t site is optional. It allows a users to log into a specific site within the tableau server installation. If you’re sharing this code and don’t want your password sent around (good InfoSec practice), you can create just a text file with your password and refer to that file with –password-file pwd.txt.
Next is the meat of the script, all 5000+ iterations. Tableau Server allows for filters to be passed into the URL. I used the export tabcmd to generate a PDF and save to a location.
tabcmd export “workbook/view?Filter=val” –pdf –pagelayout landscape -f “C:\filename.pdf”
There are some options that can be included in the export command, like landscape. Be sure to check the documentation for other possibilities. I used Excel to quickly create each line of the tabcmd, changing the Filter value.
The last thing to remember is to log out of the server. So close the batch file with tabcmd logout. Simply double click the .bat file that was created and your script will start. Thanks for reading and please let me know what you’ve been able to do with tabcmd.