Pagination in Tableau (even when exporting to PDF)


One of the key features of Tableau is its ability to customize the layout and size of dashboards to meet the needs of different users and use cases. When designing a dashboard in Tableau, there are a variety of options for sizing and layout, with preset screen sizes and resolutions available. Often, this is sufficient since dashboards are typically meant to be interactive. But occasionally (or maybe more often, depending on the industry you work in) users want to export the dashboard to a PDF and/or print it. Depending on how the dashboard has been designed, this could be easy enough, but if the dashboard presents a long list of information, such as in the style of a tabular report, that information could get cut off when printing to PDF (as seen in the image below). Let's talk about another option.



Pagination is the ability to divide a large page into smaller, more manageable pages. A few people (here and here) have come up with great solutions that calculate the number of rows of data and present them in chunks, resulting in a "pages" effect. But that doesn't help if we want to export or print the full set of data.


So, to get a more traditional looking multi-page PDF, we first need to change the size of the dashboard. Previously, I had the dashboard set to letter portrait size, but I'm going to increase the height until all the text fits on the dashboard (i.e. the scroll bar is gone). To support an ever growing list, you might want to increase the height even further. The downside is that if the list keeps growing, the size of the dashboard will need to continue to grow as well, which requires a manual change to the size.


Here is how the output looks after that change. Not great. Everything is exported on one page and it's very small.



From Tableau Server or Tableau Cloud, you can select a different scaling option (in this case, I'm looking to fit everything width wise) and then export. Fun fact: this option isn't available in the Print to PDF option in Tableau Desktop.


Yay! That did the trick. We could end things here, but if your goal is to automate the export you'll soon find that the scaling option isn't available in the programmatic export command from either tabcmd or the Tableau Server Client Python library.



My team spent weeks researching, thinking, and brainstorming about this issue. Then, the newest member of the team (Lizzy Reddy) found a brilliant solution. Within Tableau Desktop, select the dashboard tab and navigate to File > Page Setup, then select the Print Scaling tab. Select the "Fit to no more than" radio button and increase the number of pages down you are willing to accept. Make sure to publish this change to Tableau Server or Tableau Cloud. Now, when this dashboard is exported programmatically, it will fit width wise, but be multiple pages in length.



It should be noted that exporting a single, independent sheet instead of a dashboard is much easier as its length is always dynamic and isn't constrained by the dashboard sizing. This is what the export looks like without any effort.



Hopefully you found this valuable. It's entirely possible that this is something everyone already knew about, but after working with Tableau for 13 years this problem with pagination has always stumped me, so I needed to share this brilliant and easy solution.