8000 Issue 1128, add excel request option to the requests category (#1164) · tableau/server-client-python@ce18d24 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce18d24

Browse files
authored
Issue 1128, add excel request option to the requests category (#1164)
1 parent 0cda220 commit ce18d24

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/api-ref.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,6 +2548,34 @@ csv_req_option.vf('Category', 'Furniture')
25482548
# retrieve the csv data for the view
25492549
server.views.populate_csv(view_item, csv_req_option)
25502550
```
2551+
### ExcelRequestOptions class
2552+
2553+
```py
2554+
ExcelRequestOptions(maxage=-1)
2555+
```
2556+
Use this class to specify view filters to be applied when data is generated in an Excel file format. Optionally, you can specify the maximum age of the Excel data cached on the server by providing a `maxage` value. See `views.populate_csv`.
2557+
2558+
**Attributes**
2559+
2560+
Name | Description
2561+
:--- | :---
2562+
`maxage` | Optional. The maximum number of minutes the Excel data will be cached on the server before being refreshed. The value must be an integer between `1` and `240` minutes. `0` will be interpreted as 1 minute on server, as that is the shortest interval allowed. By default, `maxage` is set to `-1`, indicating the default behavior configured in server settings.
2563+
2564+
**Example**
2565+
2566+
```py
2567+
# import tableauserverclient as TSC
2568+
# server = TSC.Server('https://MY-SERVER')
2569+
# sign in, get a specific view, etc.
2570+
2571+
# set view filters
2572+
excel_req_option = TSC.ExcelRequestOptions(maxage=5)
2573+
excel_req_option.vf('Region', 'South')
2574+
excel_req_option.vf('Category', 'Furniture')
2575+
2576+
# retrieve the excel data for the view
2577+
server.views.populate_excel(view_item, excel_req_option)
2578+
```
25512579

25522580
### ImageRequestOptions class
25532581

0 commit comments

Comments
 (0)
0