Table of Contents

Class OdfPivotTableInfo

Namespace
OdfKit.Spreadsheet
Assembly
OdfKit.dll

Represents summary information for a pivot table in a spreadsheet. 表示試算表中一個樞紐分析表的摘要資訊。

public sealed class OdfPivotTableInfo
Inheritance
OdfPivotTableInfo
Inherited Members

Constructors

OdfPivotTableInfo(string, string, string, string, bool, bool, IReadOnlyList<OdfPivotTableFieldInfo>, IReadOnlyList<OdfPivotTableSortFieldInfo>, IReadOnlyList<OdfPivotTableFilterConditionInfo>)

Represents summary information for a pivot table in a spreadsheet. 表示試算表中一個樞紐分析表的摘要資訊。

public OdfPivotTableInfo(string sheetName, string name, string sourceRangeAddress, string targetRangeAddress, bool hasColumnHeaders, bool hasRowHeaders, IReadOnlyList<OdfPivotTableFieldInfo> fields, IReadOnlyList<OdfPivotTableSortFieldInfo> sortFields, IReadOnlyList<OdfPivotTableFilterConditionInfo> filterConditions)

Parameters

sheetName string

The containing sheet name. / 所在工作表名稱。

name string

The pivot table name from table:name. / 樞紐分析表名稱(table:name)。

sourceRangeAddress string

The source data range address from table:cell-range-address under table:source-cell-range. / 來源資料範圍位址(table:source-cell-rangetable:cell-range-address)。

targetRangeAddress string

The target output range start from table:target-range-address. / 目標輸出範圍起點(table:target-range-address)。

hasColumnHeaders bool

Whether the source has column headers. / 來源是否含欄標題。

hasRowHeaders bool

Whether the source has row headers. / 來源是否含列標題。

fields IReadOnlyList<OdfPivotTableFieldInfo>

The field setting list. / 欄位設定清單。

sortFields IReadOnlyList<OdfPivotTableSortFieldInfo>

The sort field list. / 排序欄位清單。

filterConditions IReadOnlyList<OdfPivotTableFilterConditionInfo>

The filter condition list. / 篩選條件清單。

Properties

Fields

Gets the field setting list. 取得欄位設定清單。

public IReadOnlyList<OdfPivotTableFieldInfo> Fields { get; }

Property Value

IReadOnlyList<OdfPivotTableFieldInfo>

FilterConditions

Gets the filter condition list. 取得篩選條件清單。

public IReadOnlyList<OdfPivotTableFilterConditionInfo> FilterConditions { get; }

Property Value

IReadOnlyList<OdfPivotTableFilterConditionInfo>

HasColumnHeaders

Gets whether the source has column headers. 取得來源是否含欄標題。

public bool HasColumnHeaders { get; }

Property Value

bool

HasRowHeaders

Gets whether the source has row headers. 取得來源是否含列標題。

public bool HasRowHeaders { get; }

Property Value

bool

Name

Gets the pivot table name. 取得樞紐分析表名稱。

public string Name { get; }

Property Value

string

SheetName

Gets the containing sheet name. 取得所在工作表名稱。

public string SheetName { get; }

Property Value

string

SortFields

Gets the sort field list. 取得排序欄位清單。

public IReadOnlyList<OdfPivotTableSortFieldInfo> SortFields { get; }

Property Value

IReadOnlyList<OdfPivotTableSortFieldInfo>

SourceRangeAddress

Gets the source data range address string. 取得來源資料範圍位址字串。

public string SourceRangeAddress { get; }

Property Value

string

TargetRangeAddress

Gets the target output range start address string. 取得目標輸出範圍起點位址字串。

public string TargetRangeAddress { get; }

Property Value

string

Methods

TryGetSourceRange(out OdfCellRange)

Attempts to parse SourceRangeAddress as an OdfCellRange. 嘗試將 SourceRangeAddress 解析為 OdfCellRange

public bool TryGetSourceRange(out OdfCellRange range)

Parameters

range OdfCellRange

The cell range returned when parsing succeeds. / 解析成功時傳回的儲存格範圍。

Returns

bool

true if parsing succeeds. / 若解析成功則為 true

TryGetTargetStart(out OdfCellAddress)

Attempts to parse TargetRangeAddress as the starting OdfCellAddress. 嘗試將 TargetRangeAddress 解析為起點 OdfCellAddress

public bool TryGetTargetStart(out OdfCellAddress address)

Parameters

address OdfCellAddress

The cell address returned when parsing succeeds. / 解析成功時傳回的儲存格位址。

Returns

bool

true if parsing succeeds. / 若解析成功則為 true

Remarks

According to the ODF 1.4 schema, table:target-range-address has the cellRangeAddress type. This method first tries to parse the value as a range and returns its start; if the string uses a single-cell address format, such as documents written by earlier versions, it falls back to parsing a single address for backward compatibility. 依 ODF 1.4 schema,table:target-range-address 的型別為 cellRangeAddress (範圍),此方法會優先嘗試以範圍格式解析並取其起點;若該字串為單一儲存格位址格式 (例如舊版本寫入的文件),則回退以單一位址格式解析,以維持向下相容。