Class OdfPivotTableBuilder
- Namespace
- OdfKit.Spreadsheet
- Assembly
- OdfKit.dll
Builds ODF pivot tables, also known as data pilot tables. 用於建構 ODF 樞紐分析表(Data Pilot Table)的產生器。
public class OdfPivotTableBuilder
- Inheritance
-
OdfPivotTableBuilder
- Inherited Members
Remarks
Initializes a new instance of the OdfPivotTableBuilder class. 初始化 OdfPivotTableBuilder 類別的新執行個體。
Constructors
OdfPivotTableBuilder(string, OdfCellRange, OdfCellAddress, OdfTableSheet)
Builds ODF pivot tables, also known as data pilot tables. 用於建構 ODF 樞紐分析表(Data Pilot Table)的產生器。
public OdfPivotTableBuilder(string name, OdfCellRange sourceRange, OdfCellAddress targetStart, OdfTableSheet sheet)
Parameters
namestringThe pivot table name. / 樞紐分析表的名稱。
sourceRangeOdfCellRangeThe source data range. / 來源資料範圍。
targetStartOdfCellAddressThe target position start. / 目標位置起點。
sheetOdfTableSheetThe owning worksheet. / 所屬的工作表。
Remarks
Initializes a new instance of the OdfPivotTableBuilder class. 初始化 OdfPivotTableBuilder 類別的新執行個體。
Methods
AddCalculatedField(string, string)
Adds a calculated field using a formula to the pivot table. 新增計算欄位(使用公式)至樞紐分析表。
public OdfPivotTableBuilder AddCalculatedField(string fieldName, string formula)
Parameters
fieldNamestringThe calculated field name. / 計算欄位名稱。
formulastringThe ODF formula, such as
of:[.Sales]/[.Count]. / ODF 公式,例如of:[.Sales]/[.Count]。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
AddColumnField(string)
Adds a column field to the pivot table. 新增資料欄欄位至樞紐分析表。
public OdfPivotTableBuilder AddColumnField(string fieldName)
Parameters
fieldNamestringThe field name. / 欄位名稱。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
AddDataField(string)
Adds a data value field and its calculation function to the pivot table. 新增資料值欄位與對應的計算函式至樞紐分析表。
public OdfPivotTableBuilder AddDataField(string fieldName)
Parameters
fieldNamestring
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
AddDataField(string, OdfPivotFunction)
Full overload of AddDataField that accepts fieldName and function. AddDataField 完整多載:接受 fieldName 與 function。
public OdfPivotTableBuilder AddDataField(string fieldName, OdfPivotFunction function)
Parameters
fieldNamestringfunctionOdfPivotFunction
Returns
AddDataField(string, string)
Adds a data value field using a raw function name string for legacy API compatibility. 新增資料值欄位,使用原始函式名稱字串(相容舊版 API)。
public OdfPivotTableBuilder AddDataField(string fieldName, string function)
Parameters
fieldNamestringThe field name. / 欄位名稱。
functionstringThe ODF function name string, such as
sumorcount. / ODF 函式名稱字串,例如sum、count。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
AddFilter(string, OdfPivotFilterOperator, string)
Adds a field filter condition to the pivot table. 新增欄位篩選條件至樞紐分析表。
public OdfPivotTableBuilder AddFilter(string fieldName, OdfPivotFilterOperator op, string value)
Parameters
fieldNamestringThe filter field name. / 篩選欄位名稱。
opOdfPivotFilterOperatorThe comparison operator. / 比較運算子。
valuestringThe filter value string. / 篩選值字串。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
AddPageField(string)
Adds a page or filter field to the pivot table. 新增頁面/篩選欄位至樞紐分析表。
public OdfPivotTableBuilder AddPageField(string fieldName)
Parameters
fieldNamestringThe field name. / 欄位名稱。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
AddRowField(string)
Adds a row field to the pivot table. 新增資料列欄位至樞紐分析表。
public OdfPivotTableBuilder AddRowField(string fieldName)
Parameters
fieldNamestringThe field name. / 欄位名稱。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
AddSortInfo(string)
Short overload of AddSortInfo that accepts fieldName; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 fieldName;其餘可選參數使用預設值並轉呼叫最長 AddSortInfo 多載。
public OdfPivotTableBuilder AddSortInfo(string fieldName)
Parameters
fieldNamestring
Returns
AddSortInfo(string, bool)
Sets the sort direction for the specified field. 為指定欄位設定排序方向。
public OdfPivotTableBuilder AddSortInfo(string fieldName, bool ascending)
Parameters
fieldNamestringThe sort field name. / 排序欄位名稱。
ascendingboolWhether sorting is ascending; the default is true. / 是否升冪排序,預設為 true。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
Build()
Builds and applies the pivot table to the worksheet. 建置並將樞紐分析表套用至工作表中。
public OdfNode Build()
Returns
- OdfNode
The XML node that represents the built pivot table. / 代表建置後之樞紐分析表的 XML 節點。
ConfigureValueField(string, OdfPivotValueOptions)
Configures a derived display calculation for a data field. 設定資料欄位的衍生顯示計算。
public OdfPivotTableBuilder ConfigureValueField(string fieldName, OdfPivotValueOptions options)
Parameters
fieldNamestringThe data field name. / 資料欄位名稱。
optionsOdfPivotValueOptionsThe value options. / 值選項。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
GroupField(string, OdfPivotGroupingOptions)
Configures bounded grouping for a row or column field. 設定資料列或資料欄欄位的有界分組。
public OdfPivotTableBuilder GroupField(string fieldName, OdfPivotGroupingOptions options)
Parameters
fieldNamestringThe source field name. / 來源欄位名稱。
optionsOdfPivotGroupingOptionsThe grouping options. / 分組選項。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
Refresh()
Computes and materializes the current pivot result with default limits. 以預設限制計算並物化目前的樞紐結果。
public OdfPivotRefreshResult Refresh()
Returns
- OdfPivotRefreshResult
The refresh report. / 刷新報告。
Refresh(OdfPivotRefreshOptions?, CancellationToken)
Computes and materializes the current pivot result at the configured target. 計算目前樞紐結果並物化至設定的目標位置。
public OdfPivotRefreshResult Refresh(OdfPivotRefreshOptions? options, CancellationToken cancellationToken)
Parameters
optionsOdfPivotRefreshOptionsThe resource limits, or null for defaults. / 資源限制;null 表示使用預設值。
cancellationTokenCancellationTokenThe cancellation token. / 取消權杖。
Returns
- OdfPivotRefreshResult
The refresh report. / 刷新報告。
WithColumnHeaders()
Short overload of WithColumnHeaders that uses default values for all optional parameters and forwards to the full overload. 便利多載:WithColumnHeaders 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfPivotTableBuilder WithColumnHeaders()
Returns
WithColumnHeaders(bool)
Keeps source column header intent for fluent API compatibility without emitting nonstandard attributes. 保留來源欄標題意圖以相容 Fluent API,但不輸出非標準屬性。
public OdfPivotTableBuilder WithColumnHeaders(bool hasHeaders)
Parameters
hasHeadersbool
Returns
WithDrillDown(bool)
Configures the consumer drill-down hint. 設定閱讀器的向下鑽研提示。
public OdfPivotTableBuilder WithDrillDown(bool enabled)
Parameters
enabledboolWhether drill-down is enabled. / 是否啟用向下鑽研。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
WithFilterButton(bool)
Configures the ODF filter button. 設定 ODF 篩選按鈕。
public OdfPivotTableBuilder WithFilterButton(bool show)
Parameters
showboolWhether the filter button is shown. / 是否顯示篩選按鈕。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
WithGrandTotals(OdfPivotGrandTotal)
Configures grand totals for materialization and ODF persistence. 設定物化結果與 ODF 持久化的總計。
public OdfPivotTableBuilder WithGrandTotals(OdfPivotGrandTotal grandTotals)
Parameters
grandTotalsOdfPivotGrandTotalThe axes that receive grand totals. / 要顯示總計的軸。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
WithLayout(OdfPivotLayout)
Configures the ODF field layout. 設定 ODF 欄位版面。
public OdfPivotTableBuilder WithLayout(OdfPivotLayout layout)
Parameters
layoutOdfPivotLayoutThe layout mode. / 版面模式。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
WithOutputStyles(OdfPivotOutputStyleOptions)
Configures existing cell styles used by materialized output. 設定物化輸出使用的既有儲存格樣式。
public OdfPivotTableBuilder WithOutputStyles(OdfPivotOutputStyleOptions options)
Parameters
optionsOdfPivotOutputStyleOptionsThe output style options. / 輸出樣式選項。
Returns
- OdfPivotTableBuilder
The current instance for chaining. / 目前執行個體,以支援鏈結呼叫。
WithRowHeaders()
Short overload of WithRowHeaders that uses default values for all optional parameters and forwards to the full overload. 便利多載:WithRowHeaders 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfPivotTableBuilder WithRowHeaders()
Returns
WithRowHeaders(bool)
Keeps source row header intent for fluent API compatibility without emitting nonstandard attributes. 保留來源列標題意圖以相容 Fluent API,但不輸出非標準屬性。
public OdfPivotTableBuilder WithRowHeaders(bool hasHeaders)
Parameters
hasHeadersbool