代表篩選器控制項,用於以非協作方式篩選範圍、圖表和資料透視表。這個類別包含存取及修改現有切片器的相關方法。如要建立新的篩選器,請使用 Sheet.insertSlicer(range, anchorRowPos, anchorColPos)。
方法
內容詳盡的說明文件
get Background Color Object()
get Column Position()
傳回篩選器套用至篩選器時的資料欄位置 (相對於篩選器的資料範圍),如果未設定資料欄位置,則傳回 null。這應該是類似篩選器的欄的 1 索引位置。
回攻員
Integer|null:這個篩選器的欄位置。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Container Info()
取得資料分割器在工作表中的位置資訊。
回攻員
Container:包含 Slicer 容器位置的物件。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Filter Criteria()
傳回 Slicer 的篩選條件,如果未設定篩選條件,則傳回 null。
回攻員
Filter:這個切片器的篩選條件。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Range()
get Title()
傳回 Slicer 的標題。
回攻員
String - 這個切片器用於鏈結。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Title Horizontal Alignment()
取得標題的水平對齊方式。
回攻員
String:這個 Slicer 標題的水平對齊方式。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Title Text Style()
is Applied To Pivot Tables()
傳回指定 Slicer 是否套用至資料透視表。
回攻員
Boolean:如果這個篩選器套用至資料透視表,則為 true,否則為 false。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
remove()
刪除篩選器。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set Apply To Pivot Tables(applyToPivotTables)
set Background Color(color)
set Background Color Object(color)
set Column Filter Criteria(columnPosition, filterCriteria)
設定資料分割器的資料欄索引和篩選條件。null 值會重設篩選器。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
column | Integer | 這個 Slicer 的新資料欄位置。 |
filter | Filter | 這個 Slicer 的新篩選條件。 |
回攻員
Slicer - 這個切片器用於鏈結。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set Position(anchorRowPos, anchorColPos, offsetX, offsetY)
設定篩選器在工作表中的顯示位置。錨定列和欄位置索引是以 1 為起始。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
anchor | Integer | 這個資料列會固定為篩選器的頂端。 |
anchor | Integer | 這個 col 會錨定 Slicer 的頂端。 |
offsetX | Integer | 以像素為單位的儲存格角落水平偏移。 |
offsetY | Integer | 以像素為單位的儲存格角落垂直偏移。 |
回攻員
Slicer - 這個切片器用於鏈結。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets