Full Localization of Tableau Workbooks

This post coincides with tableau_rest_api 1.4.0 and after. As always, not officially supported by Tableau at all, but I’ll take any feedback people leave and try to improve.

Tableau has a great whitepaper that explains all of the out of the box supported localization methods. But they are not exactly “seamless”; they take a lot of effort and still result in some quirks. In this post, I’ll explore how some simple modification to the Tableau XML files can provide a method to generate “fully” translated workbooks that are won’t look out of place even when using Web Edit or See Underlying Data.

To build a translatable workbook, follow these steps:

  1. Connect to your datasource. Do not rename any fields. Also do not create any calculations
  2. Publish the datasource to Tableau Server.
  3. Save the datasource as a .TDS file for later, in case you need to make changes.
  4. Connect to the published datasource on Tableau Server. Close the original local connection
  5. Save the workbook as a TWB

Now you have a workbook that is fully ready to be translated. Keep reading for how to make it work.

(more…)

Tableau REST API 400 Error, Response Code 400011

Perhaps the best documented error in all of the Tableau REST API, Response Code 400011 is accurately described as the condition “Publishing Error”, with details “The workbook could not be published for some other reason than those specified earlier.” It’s a catch all for “you screwed up”, and there is absolutely no additional information you are going to get on what you did, even if you look at the API Server logs (trust me).

In building the rest_api_library, I’ve screwed up a whole lot, so I can at least provide a few instances where you will get 400 / 400011 for sure:

  • Publishing a TWB for a workbook that references external files (TDEs, XLSX, etc). Solutions:
    1. Re-save as a TWBX and publish the TWBX
    2. Publish your datasource to data server first, and connect the workbook to that datasource on data server
  • Publishing a TWB that references a data server source that doesn’t exist on that Site. Per the previous post on the topic, you can publish a TWB that connects to a data server source with the same name on a different site. But if you haven’t published the data source first, expect 400011 to be your fate
  • Publishing a TWB that references a data server source that published correctly, but didn’t embed credentials that are necessary. This may seem strange, but Tableau Server generates thumbnails for each worksheet at publish time, so if it can’t verify the server connection because it lacks credentials, then you’ll get a friendly 400011 response code as a reminder. Side Note: If you ever see your publish times take a long time, it is probably held up on generating the thumbnails, and it is a sign that your databoards are going to be miserably slow when people view them as well. Stop showing so much unfiltered data without doing some guided analytics first.

I’m sure there are more instances where 400011 can happen, but these are the major cases I’ve seen so far. I’ll keep updating as I come across them.

Changing database connections in TWBX and TDSX files i.e. Publishing extracts from a template

This post coincides with v1.3.0 of the tableau_rest_api library, which you should promptly be upgrading to for all the excellent functionality it provides

As shown previously, it’s not tremendously difficult to change the database/schema name (or port) in the XML of a TWB or TDS file — easy enough that we were able to add programmatic facilities for it to the tableau_rest_api library. Live connections aren’t the only side of Tableau though; extracts are an essential aspect of the Tableau experience. When we want to publish extracts, we end up using the Packaged File types - TWBX and TDSX (you may not be saving your stand alone extracts as a TDSX, but you should — a TDE file by itself stores no information about the datasource from whence it sprung, while a TDSX holds both the originating TDS and the TDE.

Packaged files are just plain ZIP files with a bit of structure (try it — you can unzip them, or ZIP up a TDS and rename the .zip to .tdsx and it will work). The main XML file (TWB or TDS) lives in the lowest level, and then data and other files exist in sub-directories. These sub-directories are not always the same, so it’s hard to generically say what will be inside. Since all we’re worried about is changing the XML file, we’ll just copy whatever we find in the sub-directories as is and hope for the best [this is a fundamental strategy in the rest_api_library : edit the least necessary pieces and copy the rest].

(more…)

Tableau 9.0, Vizportal, and Forcing Password Security

Not recommended or supported by Tableau in any way. Make a copy of all your original files and be ready to have any changes overwritten with every maintenance release.

One of the most obvious changes in Tableau Server 9.0 is the slick new UI. Under the hood it is called vizportal (replacing the old wgserver, which still lives on to serve a few other purposes). All of the web content for vizportal is stored in

C:\Program Files\Tableau\Tableau Server\9.0\vizportalclient\public\

(or the equivalent if you installed to a non-default directory / 32-bit)

In this directory there are folders for each language supported by Tableau (these will be familiar if you’ve looked at the post on adding a new language). Inside each of those directories, you’ll find identically named files that serve the same purpose — they are the raw content that gets transformed into the visible vizportal pages. Any change you make in one, you’ll need to make in all of them.

(more…)

Paginating via tabcmd for full exported PDFs

Tableau was designed to be interacted with on a computer, and the way it handles PDF export by default reflects the belief that long lists should be replaced with visual cues and filters. Sometimes you want a paper trail — not only that, sometimes it is a legal requirement.

There are plenty of documents out there discussing how to use tabcmd to export PDFs , but you’ll find that the PDFs are basically a snapshot of whatever a worksheet or dashboard looks like in its default state (even using -fullpdf flag on the export command won’t create pages for content that is not visible without scrolling). This post describes a solution to “page” through all of the content in a worksheet and one way to put it all together for export.

(more…)

Publishing Datasources and Workbooks to Multiple Sites

This post coincides with the 1.2.0 release of the tableau_rest_api library, which incorporates code for handling all of this programmatically, in an integrated way with the REST API. As always, absolutely none of this is supported and it may break at any time.

You’ve built out a some great visualizations on your test database and now want to deploy them to the production servers. And then you want to deploy to each of your customer’s sites, but each customer’s data is silo’d off. You look for the button to deploy in Tableau Desktop, but alas it does not exist. This scenario is incredibly common, particularly for SaaS software deployments or if you are deploying multiple copies of Tableau Server in different data centers. Luckily it is very possible, and there are now facilities in the tableau_rest_api library to easily handle most common use cases.

(more…)