-
Notifications
You must be signed in to change notification settings - Fork 62
/
excel.pivotfield.yml
443 lines (433 loc) · 18.4 KB
/
excel.pivotfield.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
### YamlMime:TSType
name: Excel.PivotField
uid: 'excel!Excel.PivotField:class'
package: excel!
fullName: Excel.PivotField
summary: Represents the Excel PivotField.
remarks: '\[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
type: class
properties:
- name: context
uid: 'excel!Excel.PivotField#context:member'
package: excel!
fullName: context
summary: >-
The request context associated with the object. This connects the add-in's process to the Office host
application's process.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'context: RequestContext;'
return:
type: '<xref uid="excel!Excel.RequestContext:class" />'
- name: id
uid: 'excel!Excel.PivotField#id:member'
package: excel!
fullName: id
summary: ID of the PivotField.
remarks: '\[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'readonly id: string;'
return:
type: string
- name: items
uid: 'excel!Excel.PivotField#items:member'
package: excel!
fullName: items
summary: Returns the PivotItems associated with the PivotField.
remarks: '\[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'readonly items: Excel.PivotItemCollection;'
return:
type: '<xref uid="excel!Excel.PivotItemCollection:class" />'
- name: name
uid: 'excel!Excel.PivotField#name:member'
package: excel!
fullName: name
summary: Name of the PivotField.
remarks: '\[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'name: string;'
return:
type: string
- name: showAllItems
uid: 'excel!Excel.PivotField#showAllItems:member'
package: excel!
fullName: showAllItems
summary: Determines whether to show all items of the PivotField.
remarks: '\[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'showAllItems: boolean;'
return:
type: boolean
- name: subtotals
uid: 'excel!Excel.PivotField#subtotals:member'
package: excel!
fullName: subtotals
summary: Subtotals of the PivotField.
remarks: '\[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'subtotals: Excel.Subtotals;'
return:
type: '<xref uid="excel!Excel.Subtotals:interface" />'
methods:
- name: applyFilter(filter)
uid: 'excel!Excel.PivotField#applyFilter:member(1)'
package: excel!
fullName: applyFilter(filter)
summary: >-
Sets one or more of the field's current PivotFilters and applies them to the field. If the provided filters are
invalid or cannot be applied, an exception is thrown.
remarks: '\[ [API set: ExcelApi 1.12](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'applyFilter(filter: Excel.PivotFilters): void;'
parameters:
- id: filter
description: 'A configured specific PivotFilter, or a PivotFilters interface containing multiple configured filters.'
type: '<xref uid="excel!Excel.PivotFilters:interface" />'
return:
type: void
description: ''
- name: clearAllFilters()
uid: 'excel!Excel.PivotField#clearAllFilters:member(1)'
package: excel!
fullName: clearAllFilters()
summary: Clears all criteria from all of the field's filters. This removes any active filtering on the field.
remarks: >-
\[ [API set: ExcelApi 1.12](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
#### Examples
```TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/38-pivottable/pivottable-pivotfilters.yaml
await Excel.run(async (context) => {
// Clear all the PivotFilters.
// Get the PivotTable.
const pivotTable = context.workbook.worksheets.getActiveWorksheet().pivotTables.getItem("Farm Sales");
pivotTable.hierarchies.load("name");
await context.sync();
// Clear the filters on each PivotField.
pivotTable.hierarchies.items.forEach((hierarchy) => {
hierarchy.fields.getItem(hierarchy.name).clearAllFilters();
});
await context.sync();
});
```
isPreview: false
isDeprecated: false
syntax:
content: 'clearAllFilters(): void;'
return:
type: void
description: ''
- name: clearFilter(filterType)
uid: 'excel!Excel.PivotField#clearFilter:member(1)'
package: excel!
fullName: clearFilter(filterType)
summary: Clears all existing criteria from the field's filter of the given type (if one is currently applied).
remarks: '\[ [API set: ExcelApi 1.12](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'clearFilter(filterType: Excel.PivotFilterType): void;'
parameters:
- id: filterType
description: The type of filter on the field of which to clear all criteria.
type: '<xref uid="excel!Excel.PivotFilterType:enum" />'
return:
type: void
description: ''
- name: clearFilter(filterTypeString)
uid: 'excel!Excel.PivotField#clearFilter:member(2)'
package: excel!
fullName: clearFilter(filterTypeString)
summary: Clears all existing criteria from the field's filter of the given type (if one is currently applied).
remarks: '\[ [API set: ExcelApi 1.12](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'clearFilter(filterTypeString: "Unknown" | "Value" | "Manual" | "Label" | "Date"): void;'
parameters:
- id: filterTypeString
description: The type of filter on the field of which to clear all criteria.
type: '"Unknown" | "Value" | "Manual" | "Label" | "Date"'
return:
type: void
description: ''
- name: getFilters()
uid: 'excel!Excel.PivotField#getFilters:member(1)'
package: excel!
fullName: getFilters()
summary: Gets all filters currently applied on the field.
remarks: '\[ [API set: ExcelApi 1.12](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'getFilters(): OfficeExtension.ClientResult<Excel.PivotFilters>;'
return:
type: >-
<xref uid="office!OfficeExtension.ClientResult:class" /><<xref uid="excel!Excel.PivotFilters:interface"
/>>
description: A PivotFilters interface with all active filters.
- name: isFiltered(filterType)
uid: 'excel!Excel.PivotField#isFiltered:member(1)'
package: excel!
fullName: isFiltered(filterType)
summary: Checks if there are any applied filters on the field.
remarks: '\[ [API set: ExcelApi 1.12](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'isFiltered(filterType?: Excel.PivotFilterType): OfficeExtension.ClientResult<boolean>;'
parameters:
- id: filterType
description: 'The filter type to check. If no type is provided, this method will check if any filter is applied.'
type: '<xref uid="excel!Excel.PivotFilterType:enum" />'
return:
type: '<xref uid="office!OfficeExtension.ClientResult:class" /><boolean>'
description: >-
True if the field has a filter of type `filterType` applied. If `filterType` is not specified, `true` is
returned if the field has any applied filters.
- name: isFiltered(filterTypeString)
uid: 'excel!Excel.PivotField#isFiltered:member(2)'
package: excel!
fullName: isFiltered(filterTypeString)
summary: Checks if there are any applied filters on the field.
remarks: '\[ [API set: ExcelApi 1.12](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: >-
isFiltered(filterTypeString?: "Unknown" | "Value" | "Manual" | "Label" | "Date"):
OfficeExtension.ClientResult<boolean>;
parameters:
- id: filterTypeString
description: 'The filter type to check. If no type is provided, this method will check if any filter is applied.'
type: '"Unknown" | "Value" | "Manual" | "Label" | "Date"'
return:
type: '<xref uid="office!OfficeExtension.ClientResult:class" /><boolean>'
description: >-
True if the field has a filter of type `filterType` applied. If `filterType` is not specified, `true` is
returned if the field has any applied filters.
- name: load(options)
uid: 'excel!Excel.PivotField#load:member(1)'
package: excel!
fullName: load(options)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'load(options?: Excel.Interfaces.PivotFieldLoadOptions): Excel.PivotField;'
parameters:
- id: options
description: Provides options for which properties of the object to load.
type: '<xref uid="excel!Excel.Interfaces.PivotFieldLoadOptions:interface" />'
return:
type: '<xref uid="excel!Excel.PivotField:class" />'
description: ''
- name: load(propertyNames)
uid: 'excel!Excel.PivotField#load:member(2)'
package: excel!
fullName: load(propertyNames)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'load(propertyNames?: string | string[]): Excel.PivotField;'
parameters:
- id: propertyNames
description: A comma-delimited string or an array of strings that specify the properties to load.
type: 'string | string[]'
return:
type: '<xref uid="excel!Excel.PivotField:class" />'
description: ''
- name: load(propertyNamesAndPaths)
uid: 'excel!Excel.PivotField#load:member(3)'
package: excel!
fullName: load(propertyNamesAndPaths)
summary: >-
Queues up a command to load the specified properties of the object. You must call `context.sync()` before reading
the properties.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: |-
load(propertyNamesAndPaths?: {
select?: string;
expand?: string;
}): Excel.PivotField;
parameters:
- id: propertyNamesAndPaths
description: >-
`propertyNamesAndPaths.select` is a comma-delimited string that specifies the properties to load, and
`propertyNamesAndPaths.expand` is a comma-delimited string that specifies the navigation properties to load.
type: |-
{
select?: string;
expand?: string;
}
return:
type: '<xref uid="excel!Excel.PivotField:class" />'
description: ''
- name: 'set(properties, options)'
uid: 'excel!Excel.PivotField#set:member(1)'
package: excel!
fullName: 'set(properties, options)'
summary: >-
Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate
properties, or another API object of the same type.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'set(properties: Interfaces.PivotFieldUpdateData, options?: OfficeExtension.UpdateOptions): void;'
parameters:
- id: properties
description: >-
A JavaScript object with properties that are structured isomorphically to the properties of the object on
which the method is called.
type: '<xref uid="excel!Excel.Interfaces.PivotFieldUpdateData:interface" />'
- id: options
description: Provides an option to suppress errors if the properties object tries to set any read-only properties.
type: '<xref uid="office!OfficeExtension.UpdateOptions:interface" />'
return:
type: void
description: ''
- name: set(properties)
uid: 'excel!Excel.PivotField#set:member(2)'
package: excel!
fullName: set(properties)
summary: 'Sets multiple properties on the object at the same time, based on an existing loaded object.'
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'set(properties: Excel.PivotField): void;'
parameters:
- id: properties
description: ''
type: '<xref uid="excel!Excel.PivotField:class" />'
return:
type: void
description: ''
- name: sortByLabels(sortBy)
uid: 'excel!Excel.PivotField#sortByLabels:member(1)'
package: excel!
fullName: sortByLabels(sortBy)
summary: >-
Sorts the PivotField. If a DataPivotHierarchy is specified, then sort will be applied based on it, if not sort
will be based on the PivotField itself.
remarks: '\[ [API set: ExcelApi 1.8](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: 'sortByLabels(sortBy: SortBy): void;'
parameters:
- id: sortBy
description: Specifies if the sorting is done in ascending or descending order.
type: '<xref uid="excel!Excel.SortBy:enum" />'
return:
type: void
description: ''
- name: 'sortByValues(sortBy, valuesHierarchy, pivotItemScope)'
uid: 'excel!Excel.PivotField#sortByValues:member(1)'
package: excel!
fullName: 'sortByValues(sortBy, valuesHierarchy, pivotItemScope)'
summary: >-
Sorts the PivotField by specified values in a given scope. The scope defines which specific values will be used to
sort when there are multiple values from the same DataPivotHierarchy.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: >-
sortByValues(sortBy: Excel.SortBy, valuesHierarchy: Excel.DataPivotHierarchy, pivotItemScope?: Array<PivotItem |
string>): void;
parameters:
- id: sortBy
description: Specifies if the sorting is done in ascending or descending order.
type: '<xref uid="excel!Excel.SortBy:enum" />'
- id: valuesHierarchy
description: Specifies the values hierarchy on the data axis to be used for sorting.
type: '<xref uid="excel!Excel.DataPivotHierarchy:class" />'
- id: pivotItemScope
description: >-
The items that should be used for the scope of the sorting. These will be the items that make up the row or
column that you want to sort on. If a string is used instead of a PivotItem, the string represents the ID of
the PivotItem. If there are no items other than data hierarchy on the axis you want to sort on, this can be
empty.
type: 'Array<<xref uid="excel!Excel.PivotItem:class" /> | string>'
return:
type: void
description: ''
- name: 'sortByValues(sortByString, valuesHierarchy, pivotItemScope)'
uid: 'excel!Excel.PivotField#sortByValues:member(2)'
package: excel!
fullName: 'sortByValues(sortByString, valuesHierarchy, pivotItemScope)'
summary: >-
Sorts the PivotField by specified values in a given scope. The scope defines which specific values will be used to
sort when there are multiple values from the same DataPivotHierarchy.
remarks: '\[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
isPreview: false
isDeprecated: false
syntax:
content: >-
sortByValues(sortByString: "Ascending" | "Descending", valuesHierarchy: Excel.DataPivotHierarchy,
pivotItemScope?: Array<PivotItem | string>): void;
parameters:
- id: sortByString
description: Specifies if the sorting is done in ascending or descending order.
type: '"Ascending" | "Descending"'
- id: valuesHierarchy
description: Specifies the values hierarchy on the data axis to be used for sorting.
type: '<xref uid="excel!Excel.DataPivotHierarchy:class" />'
- id: pivotItemScope
description: >-
The items that should be used for the scope of the sorting. These will be the items that make up the row or
column that you want to sort on. If a string is used instead of a PivotItem, the string represents the ID of
the PivotItem. If there are no items other than data hierarchy on the axis you want to sort on, this can be
empty.
type: 'Array<<xref uid="excel!Excel.PivotItem:class" /> | string>'
return:
type: void
description: ''
- name: toJSON()
uid: 'excel!Excel.PivotField#toJSON:member(1)'
package: excel!
fullName: toJSON()
summary: >-
Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to
`JSON.stringify()`<!-- -->. (`JSON.stringify`<!-- -->, in turn, calls the `toJSON` method of the object that is
passed to it.) Whereas the original Excel.PivotField object is an API object, the `toJSON` method returns a plain
JavaScript object (typed as `Excel.Interfaces.PivotFieldData`<!-- -->) that contains shallow copies of any loaded
child properties from the original object.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'toJSON(): Excel.Interfaces.PivotFieldData;'
return:
type: '<xref uid="excel!Excel.Interfaces.PivotFieldData:interface" />'
description: ''
extends: '<xref uid="office!OfficeExtension.ClientObject:class" />'