divinorum-webb / tableau-api-lib

An API library that allows developers to call on the methods listed in Tableau's REST API documentation.
MIT License
96 stars 34 forks source link

I cannot get pdf_page_size='Unspecified' working in conn.create_subscription() #109

Closed iibarant closed 1 year ago

iibarant commented 1 year ago

I really need to set up pdf subscription request with pdf_page_size='Unspecified', but that returns an error:

_invalid_parameter_exception raise InvalidParameterException(class_name=self.class.name, parameters=vars(self))

InvalidParameterException: " CreateSubscriptionRequest received an invalid combination of parameters.

... '_pdf_page_orientation': 'Portrait', '_pdf_page_size': 'Unspecified', '_send_view_if_empty_flag': True}

Is this possible to fix?

divinorum-webb commented 1 year ago

The REST API does not support that option. You can look up the available options in Tableau's API reference and you will find this info on the page type/size:

"(Optional) The type of page, which determines the page dimensions of the .pdf file returned. The value can be: A3, A4, A5, B5, Executive, Folio, Ledger, Legal, Letter, Note, Quarto, or Tabloid.

If this parameter is not present the page type will default to Legal."

I typically use A4 with decent results. The exception you see thrown is due to "Unspecified" not being an option provided by Tableau in their API docs.