You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use this class to specify the resolution of the view returned as an image. See `views.populate_view`.
1574
+
Use this class to specify the resolution of the view returned as an image. You can also use this class to specify view filters to be applied when the image is generated. See `views.populate_image`.
1552
1575
1553
1576
**Attributes**
1554
1577
1555
1578
Name | Description
1556
1579
:--- | :---
1557
-
`imageresolution` | The resolution of the view returned as an image. You set this option with the `Resolution` class. If unspecified, the `views.populate_view` method returns an image with standard resolution (the width of the returned image is 784 pixels). If you set this parameter value to high (`Resolution.High`), the width of the returned image is 1568 pixels. For both resolutions, the height varies to preserve the aspect ratio of the view.
1580
+
`imageresolution` | The resolution of the view returned as an image. You set this option with the `Resolution` class. If unspecified, the `views.populate_image` method returns an image with standard resolution (the width of the returned image is 784 pixels). If you set this parameter value to high (`Resolution.High`), the width of the returned image is 1568 pixels. For both resolutions, the height varies to preserve the aspect ratio of the view.
1558
1581
1582
+
**View Filters**
1559
1583
1584
+
You can use the `vf('filter_name', 'filter_value')` method to add view filters. When the image is generated, the specified filters will be applied to the view.
Use this class to specify the format of the PDF that is returned for the view. See `views.populate_pdf`.
1583
1610
@@ -1588,6 +1615,8 @@ Name | Description
1588
1615
`page_type` | The type of page returned in PDF format for the view. The page_type is set using the `PageType` class: <br> `PageType.A3`<br> `PageType.A4`<br> `PageType.A5`<br> `PageType.B5`<br> `PageType.Executive`<br> `PageType.Folio`<br> `PageType.Ledger`<br> `PageType.Legal`<br> `PageType.Letter`<br> `PageType.Note`<br> `PageType.Quarto`<br> `PageType.Tabloid`
1589
1616
`orientation` | The orientation of the page. The options are portrait and landscape. The options are set using the `Orientation` class: <br>`Orientation.Portrait`<br> `Orientation.Landscape`
1590
1617
1618
+
**View Filters**
1619
+
You can use the `vf('filter_name', 'filter_value')` method to add view filters. When the PDF is generated, the specified filters will be applied to the view.
`View item missing ID or workbook ID` | Raises an error if the ID of the view or workbook is missing.
3139
3171
3140
3172
3141
-
3142
3173
**Returns**
3143
3174
3144
3175
None. The preview image is added to `view_item` and can be accessed by its `preview_image` field.
3145
3176
3177
+
**Example**
3178
+
```py
3179
+
# Sign in, get view, etc.
3180
+
3181
+
# Populate and save the preview image as 'view_preview_image.png'
3182
+
server.views.populate_preview_image(view_item)
3183
+
withopen('./view_preview_image.png', 'wb') as f:
3184
+
f.write(view_item.preview_image)
3185
+
```
3186
+
3146
3187
See [ViewItem class](#viewitem-class)
3147
3188
3148
3189
<br>
@@ -3169,7 +3210,7 @@ This endpoint is available with REST API version 2.5 and up.
3169
3210
Name | description
3170
3211
:--- | :---
3171
3212
`view_item` | Specifies the view to populate.
3172
-
`req_options` | (Optional) You can pass in a request object to specify a high resolution image. By default, the image will be in low resolution. See [ImageRequestOptions class](#imagerequestoptions-class) for more details.
3213
+
`req_options` | (Optional) You can pass in a request object to specify a high resolution image. By default, the image will be in low resolution. You can also specify view filters to be applied when the image is generated. See [ImageRequestOptions class](#imagerequestoptions-class) for more details.
3173
3214
3174
3215
**Exceptions**
3175
3216
@@ -3181,6 +3222,16 @@ Error | Description
3181
3222
3182
3223
None. The image is added to the `view_item` and can be accessed by its `image` field.
3183
3224
3225
+
**Example**
3226
+
```py
3227
+
# Sign in, get view, etc.
3228
+
3229
+
# Populate and save the view image as 'view_image.png'
3230
+
server.views.populate_image(view_item)
3231
+
withopen('./view_image.png', 'wb') as f:
3232
+
f.write(view_item.image)
3233
+
```
3234
+
3184
3235
See [ViewItem class](#viewitem-class)
3185
3236
3186
3237
<br>
@@ -3206,6 +3257,7 @@ This endpoint is available with REST API version 2.7 and up.
3206
3257
Name | description
3207
3258
:--- | :---
3208
3259
`view_item` | Specifies the view to populate.
3260
+
`req_options` | (Optional) You can pass in a request object to specify view filters to be applied when the CSV data is generated. See [CSVRequestOptions class](#csvrequestoptions-class) for more details.
3209
3261
3210
3262
**Exceptions**
3211
3263
@@ -3217,6 +3269,17 @@ Error | Description
3217
3269
3218
3270
None. The CSV data is added to the `view_item` and can be accessed by its `csv` field.
3219
3271
3272
+
**Example**
3273
+
```py
3274
+
# Sign in, get view, etc.
3275
+
3276
+
# Populate and save the CSV data as 'view_csv.csv'
3277
+
server.views.populate_csv(view_item)
3278
+
withopen('./view_csv.csv', 'wb') as f:
3279
+
# Perform byte join on the CSV data
3280
+
f.write(b''.join(view_item.csv))
3281
+
```
3282
+
3220
3283
See [ViewItem class](#viewitem-class)
3221
3284
3222
3285
<br>
@@ -3242,7 +3305,7 @@ This endpoint is available with REST API version 2.7 and up.
3242
3305
Name | description
3243
3306
:--- | :---
3244
3307
`view_item` | Specifies the view to populate.
3245
-
AFED
`req_options` | (Optional) You can pass in a request object to specify the page type and orientation of the PDF content. If not specified, PDF content will have default page type and orientation. See [PDFRequestOptions class](#pdfrequestoptions-class) for more details.
3308
+
`req_options` | (Optional) You can pass in a request object to specify the page type and orientation of the PDF content. If not specified, PDF content will have default page type and orientation. You can also specify view filters to be applied when the PDF is generated. See [PDFRequestOptions class](#pdfrequestoptions-class) for more details.
3246
3309
3247
3310
**Exceptions**
3248
3311
@@ -3254,6 +3317,16 @@ Error | Description
3254
3317
3255
3318
None. The PDF content is added to the `view_item` and can be accessed by its `pdf` field.
3256
3319
3320
+
**Example**
3321
+
```py
3322
+
# Sign in, get view, etc.
3323
+
3324
+
# Populate and save the view pdf as 'view_pdf.pdf'
0 commit comments