What is the page size set to in the viz when you use File->Page Setup in Tableau Desktop?
sorry for the late reply.
In Page Setup (Tableau Desktop) there is no setting related to the page size,
I can only set: margins, center (checked in Horizontally and Vertically), Print Scaling (checked Fit to no more than 1 by 1), Page Orientation (Portrait).
My size dashboard is set to A4 Portrait in Tableau desktop.
In Tableau Server when I export to pdf (Download – PDF) if I set the page size “A4”, my viz is centered on the page, instead if I use page size "Letter" my viz is not centered.
Same thing if I use tabcmd commands:
tabcmd export "...." --fullpdf --pagesize a4 , my viz is centered on page
tabcmd export "...." –fullpdf (default pagesize is “Letter”, my viz is not centered.
I would like to understand if I can add pagesize parameter in Viz Allert
Unfortunately, you cannot pass in a pagesize parameter in to a content reference within VizAlerts. I don't expect we'll get to adding that as a feature in the near term, either, so if you need something immediately, you will need to add the code needed to do so.
thanks for the answer.
We would like to develop the functionality in vizalerts.
We have seen in the python module vizalert/tabhttp.py at line 191 how the url is built to download the pdf from tableau server.
Can you tell us which querystring parameter we need to pass in order to specify the page size (A4, Letter, etc.)?
That's the trouble; there isn't one. Otherwise you'd already have this feature!
Here's the list of embed URL Parameters: Parameters for Embed Code. Pagesize just isn't there.
The only real way to do this programmatically would be to integrate Tabcmd into it. This is a command-line executable that will require some more extensive code changes, config changes, and documentation changes to integrate. It also would not work for Linux machines, something that VizAlerts will currently run on. All these reasons are why we haven't integrated it ourselves yet.
For your own purposes, you could hack it in, but I'd estimate the work to require maybe four to eight days of dedicated developer and testing time. You'd probably need the following:
1. New config values in config/vizalerts.yaml for the username / password for a Server Admin account used for tabcmd calls.
2. Code changes to the find_viz_refs function to add a new parameter to content references. I'd suggest it be of the format "|pagesize=###"
2a. Code changes to the same function, around here, to detect any content reference that uses your new parameter for PDF exports, and route that call to a different function that calls Tabcmd, or maybe add that logic to tabhttp.export_view.
3. Wherever you put that logic, the command you'll want to do is:
"tabcmd export 'yourworkbook/yourview' --pdf --pagesize=yourpagesize --filename=yourfilename --timeout=yourtimeout -s yourserver -u youradminuser -p youradminpassword --no-cookie"
Couple of other thoughts:
- Might want to include a conditional --no-certcheck parameter since we support that with the server.certcheck value in config\vizalerts.yaml
- Should make the tabcmd call work with a password file, rather than a plaintext password, which is a slightly more secure option (whatever the case, don't output your password to any logs!)
- I'd love to make a new Action of type "Tabcmd" (or maybe "Tableau Server") that we could put a bunch of the different Tabcmd stuff into...publish, export, refreshextracts, etc. That's probably the real way to get what we want out of this, long-term.
Has this been added in 2018.2 ?
I am wondering why tableau doesn't let us pass the parameter of pagesize if we can be able to pass other parameters. Tableau basically specializes in making very simple things painful for people that use the tool
Tableau is always a work in progress... I regularly see feature B being added as an extra option (and potential replacement) for feature A only sub-features A.N and A.M aren't implemented in B. For example when first implemented the REST API did not have a capability to download images, now it does, and in case the pagesize options that are available through manual export and tabcmd still haven't been made available through the REST API.