tableau / tabcmd

A Python based app that replicates the functionality of the existing TabCMD command line utility
https://tableau.github.io/tabcmd/
MIT License
44 stars 12 forks source link

PDF export dashboards which are partially loaded #310

Open alkeshhc1 opened 1 month ago

alkeshhc1 commented 1 month ago

Hi, I'm exporting a dashboard as a pdf and cycle through different parameters to get separate pdfs and save them locally.

Around half the PDFs are exported with no issue and successfully output the pdf as expected, although half of the PDFs have many blanks visuals where the data has not loaded.

When going to the URL with the parameter filter exporting the PDF manually in the web-browser, the outputs look as intended.

How can I ensure tabcmd has waited for the visuals to load before exporting the PDFs? It consistently happens on the same parameters/views. I've also tried to refresh the data in Tableau web, but the PDFs still fail to export correctly using tabcmd.

jacalata commented 1 month ago

I have not come across this before - can you share the parameters you're passing in that fail, and any comparison command that does work on the same viz? Is there anything in common between the vizzes that it fails on?

alkeshhc1 commented 4 weeks ago

Hi, I'm parsing a single parameter (name). The parameter works when I paste it into a web browser and there's no strange characters/commas/dashes which may implicate it. It's only uppercase letters with spaces which (replaced with %20 and that seems to work). Also, there's no commonality with the parameters which fail and length of parameter text.

Yes, there's a common set of worksheets which fail in the export in one dashboard (the same workseets show as blank when exporting using tabcmd, but have content when exporting via the web browser, which is why I'm suspicious that it's being exported before the data has loaded).

The dashboard doesn't do anything fancy with actions etc, it's basically filter on the parameter and export.

There's another dashboard which I have where with certain parameters, the view doesn't change with tabcmd exports, but does change when doing it in a web-browser. Again, this feels like a wait till information is updated issue, but I'll park this issue for now till the above is solved in case it's the same fix.

I've tried to use tabcmd.exe command line and python, but get the same results, tabcmd v2.0.14 and v2.0.13

Sample code below: import tabcmd import os os.system("tabcmd login --server https://eu-west-1a.online.tableau.com --site [SITE] --token-name [TOKENNAME] --token-value [TOKENVALUE]") command1 = "tabcmd export \"[workbook]/[dashboard]?refresh=yes&Parameters.Name=[NAME]%20[NAME2]%20[NAME3]\"" command2 = " --pdf --pagesize a4 -f " command3 = "\"C:\Users\[USERPROFILE]\Desktop\[NAME] [NAME2] [NAME3].pdf\"" command4 = command1+command2+command3 os.system(command4)