-
Notifications
You must be signed in to change notification settings - Fork 61
/
excel.fillpattern.yml
200 lines (185 loc) · 7.63 KB
/
excel.fillpattern.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
### YamlMime:TSEnum
name: Excel.FillPattern
uid: 'excel!Excel.FillPattern:enum'
package: excel!
fullName: Excel.FillPattern
summary: ''
remarks: >-
\[ [API set: ExcelApi 1.9](/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/42-range/cell-properties.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getActiveWorksheet();
// Creating the SettableCellProperties objects to use for the range.
// In your add-in, these should be created once, outside the function.
const topHeaderProps: Excel.SettableCellProperties = {
// The style property takes a string matching the name of an Excel style.
// Built-in style names are listed in the `BuiltInStyle` enum.
// Note that a style will overwrite any formatting,
// so do not use the format property with the style property.
style: "Heading1"
};
const headerProps: Excel.SettableCellProperties = {
// Any subproperties of format that are not set will not be changed when these cell properties are set.
format: {
fill: {
color: "Blue"
},
font: {
color: "White",
bold: true
}
}
};
const nonApplicableProps: Excel.SettableCellProperties = {
format: {
fill: {
pattern: Excel.FillPattern.gray25
},
font: {
color: "Gray",
italic: true
}
}
};
const matchupScoreProps: Excel.SettableCellProperties = {
format: {
borders: {
bottom: {
style: Excel.BorderLineStyle.continuous
},
left: {
style: Excel.BorderLineStyle.continuous
},
right: {
style: Excel.BorderLineStyle.continuous
},
top: {
style: Excel.BorderLineStyle.continuous
}
}
}
};
const range = sheet.getRange("A1:E5");
// You can use empty JSON objects to avoid changing a cell's properties.
range.setCellProperties([
[topHeaderProps, {}, {}, {}, {}],
[{}, {}, headerProps, headerProps, headerProps],
[{}, headerProps, nonApplicableProps, matchupScoreProps, matchupScoreProps],
[{}, headerProps, matchupScoreProps, nonApplicableProps, matchupScoreProps],
[{}, headerProps, matchupScoreProps, matchupScoreProps, nonApplicableProps]
]);
sheet.getUsedRange().format.autofitColumns();
await context.sync();
});
```
isPreview: false
isDeprecated: false
fields:
- name: checker
uid: 'excel!Excel.FillPattern.checker:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Checker"'
- name: crissCross
uid: 'excel!Excel.FillPattern.crissCross:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"CrissCross"'
- name: down
uid: 'excel!Excel.FillPattern.down:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Down"'
- name: gray16
uid: 'excel!Excel.FillPattern.gray16:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Gray16"'
- name: gray25
uid: 'excel!Excel.FillPattern.gray25:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Gray25"'
- name: gray50
uid: 'excel!Excel.FillPattern.gray50:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Gray50"'
- name: gray75
uid: 'excel!Excel.FillPattern.gray75:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Gray75"'
- name: gray8
uid: 'excel!Excel.FillPattern.gray8:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Gray8"'
- name: grid
uid: 'excel!Excel.FillPattern.grid:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Grid"'
- name: horizontal
uid: 'excel!Excel.FillPattern.horizontal:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Horizontal"'
- name: lightDown
uid: 'excel!Excel.FillPattern.lightDown:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"LightDown"'
- name: lightHorizontal
uid: 'excel!Excel.FillPattern.lightHorizontal:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"LightHorizontal"'
- name: lightUp
uid: 'excel!Excel.FillPattern.lightUp:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"LightUp"'
- name: lightVertical
uid: 'excel!Excel.FillPattern.lightVertical:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"LightVertical"'
- name: linearGradient
uid: 'excel!Excel.FillPattern.linearGradient:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"LinearGradient"'
- name: none
uid: 'excel!Excel.FillPattern.none:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"None"'
- name: rectangularGradient
uid: 'excel!Excel.FillPattern.rectangularGradient:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"RectangularGradient"'
- name: semiGray75
uid: 'excel!Excel.FillPattern.semiGray75:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"SemiGray75"'
- name: solid
uid: 'excel!Excel.FillPattern.solid:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Solid"'
- name: up
uid: 'excel!Excel.FillPattern.up:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Up"'
- name: vertical
uid: 'excel!Excel.FillPattern.vertical:member'
package: excel!
summary: '* \[ [API set: ExcelApi 1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]'
value: '"Vertical"'