Table of Contents

Class OdfTableSheet

Namespace
OdfKit.Spreadsheet
Assembly
OdfKit.dll

Provides the OdfTableSheet API. 提供 OdfTableSheet API。

public class OdfTableSheet
Inheritance
OdfTableSheet
Inherited Members

Properties

Cells

Gets the cell collection for this worksheet. 取得此工作表的儲存格集合。

public OdfCellCollection Cells { get; }

Property Value

OdfCellCollection

Columns

Gets the column collection for this worksheet. 取得此工作表的欄集合。

public OdfColumnCollection Columns { get; }

Property Value

OdfColumnCollection

ConditionalFormats

Gets the LibreOffice calcext conditional formatting rules in this worksheet. 取得此工作表中的 LibreOffice calcext 條件格式規則清單。

public IReadOnlyList<OdfConditionalFormatInfo> ConditionalFormats { get; }

Property Value

IReadOnlyList<OdfConditionalFormatInfo>

FrozenPanes

Gets the frozen pane settings for the current worksheet. 取得目前工作表的凍結窗格設定。

public OdfFrozenPanes FrozenPanes { get; }

Property Value

OdfFrozenPanes

IsProtected

Gets a value indicating whether worksheet protection is enabled. 取得一個值,指出此工作表是否啟用保護。

public bool IsProtected { get; }

Property Value

bool

MaxHotPages

Gets or sets the maximum number of "hot" (uncompressed) native cell pages kept resident in memory for this worksheet before the least-recently-used page is evicted to compressed cold storage. See OdfKit.DOM.TableTableElement.MaxHotPages for details. 取得或設定此工作表保留在記憶體中的「熱」(未壓縮)原生儲存格頁面數量上限,超過時最久未存取的頁面會被淘汰至壓縮冷儲存。詳見 OdfKit.DOM.TableTableElement.MaxHotPages

public int MaxHotPages { get; set; }

Property Value

int

Exceptions

ArgumentOutOfRangeException

Thrown when set to a value less than 1. / 當設定值小於 1 時擲出。

Name

Gets or sets the worksheet name. 取得或設定工作表的名稱。

public string Name { get; set; }

Property Value

string

NamedExpressions

Gets the named expressions in this worksheet. 取得此工作表中的具名運算式清單。

public IReadOnlyList<OdfNamedExpressionInfo> NamedExpressions { get; }

Property Value

IReadOnlyList<OdfNamedExpressionInfo>

NamedRanges

Gets the named ranges in this worksheet. 取得此工作表中的命名範圍清單。

public IReadOnlyList<OdfNamedRangeInfo> NamedRanges { get; }

Property Value

IReadOnlyList<OdfNamedRangeInfo>

Ranges

Gets the cell range collection for this worksheet. 取得此工作表的儲存格範圍集合。

public OdfRangeCollection Ranges { get; }

Property Value

OdfRangeCollection

Rows

Gets the row collection for this worksheet. 取得此工作表的列集合。

public OdfRowCollection Rows { get; }

Property Value

OdfRowCollection

SparklineGroups

Gets the LibreOffice calcext sparkline groups in this worksheet. 取得此工作表中的 LibreOffice calcext 走勢圖群組清單。

public IReadOnlyList<OdfSparklineGroupInfo> SparklineGroups { get; }

Property Value

IReadOnlyList<OdfSparklineGroupInfo>

UsedCells

Gets the used cells in this worksheet. 取得此工作表中已使用的儲存格列舉。

public IEnumerable<OdfCell> UsedCells { get; }

Property Value

IEnumerable<OdfCell>

ViewSplitPanes

Gets the split pane settings for the current worksheet in non-frozen mode. 取得目前工作表的分割窗格設定(非凍結模式)。

public OdfSplitPanes ViewSplitPanes { get; }

Property Value

OdfSplitPanes

Visible

Gets or sets whether the worksheet is visible. 取得或設定工作表是否顯示。

public bool Visible { get; set; }

Property Value

bool

WritingMode

Gets or sets the worksheet writing mode. 取得或設定工作表的書寫方向。

public OdfWritingMode WritingMode { get; set; }

Property Value

OdfWritingMode

Methods

AddColorScaleFormat(OdfCellRange, OdfColor, OdfColor)

Short overload of AddColorScaleFormat that accepts range, minColor, and maxColor; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 range、minColor 與 maxColor;其餘可選參數使用預設值並轉呼叫最長 AddColorScaleFormat 多載。

public void AddColorScaleFormat(OdfCellRange range, OdfColor minColor, OdfColor maxColor)

Parameters

range OdfCellRange
minColor OdfColor
maxColor OdfColor

AddColorScaleFormat(OdfCellRange, OdfColor, OdfColor, OdfColor?)

Adds a two-color or three-color scale conditional format. 新增色階條件格式(兩色或三色)。

public void AddColorScaleFormat(OdfCellRange range, OdfColor minColor, OdfColor maxColor, OdfColor? midColor)

Parameters

range OdfCellRange

The cell range. / 套用範圍

minColor OdfColor

The numeric value. / 最小值對應色彩

maxColor OdfColor

The numeric value. / 最大值對應色彩

midColor OdfColor?

The numeric value. / 中間值對應色彩(可選,設定時為三色色階)

AddConditionalFormat(OdfCellRange, string, string)

Adds a conditional format. 新增條件格式。

public void AddConditionalFormat(OdfCellRange range, string conditionValue, string styleName)

Parameters

range OdfCellRange

The cell range. / 儲存格範圍

conditionValue string

The value to use. / 條件運算式

styleName string

The name or identifier. / 要套用的格式樣式名稱

AddDataBar(OdfCellRange, OdfColor)

Short overload of AddDataBar that accepts range and color; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 range 與 color;其餘可選參數使用預設值並轉呼叫最長 AddDataBar 多載。

public void AddDataBar(OdfCellRange range, OdfColor color)

Parameters

range OdfCellRange
color OdfColor

AddDataBar(OdfCellRange, OdfColor, OdfColor?)

Adds a data bar conditional format. 新增資料橫條條件格式。

public void AddDataBar(OdfCellRange range, OdfColor color, OdfColor? negativeColor)

Parameters

range OdfCellRange

The cell range. / 套用範圍

color OdfColor

The numeric value. / 正值橫條色彩

negativeColor OdfColor?

The numeric value. / 負值橫條色彩(可選)

AddDataBarFormat(OdfCellRange, OdfColor)

Short overload of AddDataBarFormat that accepts range and positiveColor; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 range 與 positiveColor;其餘可選參數使用預設值並轉呼叫最長 AddDataBarFormat 多載。

public void AddDataBarFormat(OdfCellRange range, OdfColor positiveColor)

Parameters

range OdfCellRange
positiveColor OdfColor

AddDataBarFormat(OdfCellRange, OdfColor, OdfColor?)

Adds a data bar conditional format. 新增資料橫條條件格式。

public void AddDataBarFormat(OdfCellRange range, OdfColor positiveColor, OdfColor? negativeColor)

Parameters

range OdfCellRange

The cell range. / 套用範圍

positiveColor OdfColor

The numeric value. / 正值橫條色彩

negativeColor OdfColor?

The numeric value. / 負值橫條色彩(可選)

AddDatabaseRange(string, OdfCellRange)

Adds a database range to this worksheet. 新增資料庫範圍至此工作表。

public OdfDatabaseRange AddDatabaseRange(string name, OdfCellRange range)

Parameters

name string

The name or identifier. / 資料庫範圍名稱

range OdfCellRange

The cell range. / 目標儲存格範圍

Returns

OdfDatabaseRange

The result. / 新增的資料庫範圍

AddIconSet(OdfCellRange, OdfIconSetType)

Adds an icon set conditional format. 新增圖示集條件格式。

public void AddIconSet(OdfCellRange range, OdfIconSetType iconSet)

Parameters

range OdfCellRange

The cell range. / 套用範圍

iconSet OdfIconSetType

The value to use. / 圖示集類型

AddIconSetFormat(OdfCellRange, OdfIconSetType)

Adds an icon set conditional format. 新增圖示集條件格式。

public void AddIconSetFormat(OdfCellRange range, OdfIconSetType iconSet)

Parameters

range OdfCellRange

The cell range. / 套用範圍

iconSet OdfIconSetType

The value to use. / 圖示集類型

AddNamedExpression(string, string)

Short overload of AddNamedExpression that accepts name and expression; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 name 與 expression;其餘可選參數使用預設值並轉呼叫最長 AddNamedExpression 多載。

public void AddNamedExpression(string name, string expression)

Parameters

name string
expression string

AddNamedExpression(string, string, OdfCellAddress?)

Adds a named expression to this worksheet. 新增具名運算式至此工作表。

public void AddNamedExpression(string name, string expression, OdfCellAddress? baseCell)

Parameters

name string

The named expression's name. / 具名運算式的名稱。

expression string

The formula expression string. / 公式運算式字串。

baseCell OdfCellAddress?

The base cell address. / 基準儲存格位址。

AddNamedRange(string, OdfCellRange)

Short overload of AddNamedRange that accepts name and range; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 name 與 range;其餘可選參數使用預設值並轉呼叫最長 AddNamedRange 多載。

public void AddNamedRange(string name, OdfCellRange range)

Parameters

name string
range OdfCellRange

AddNamedRange(string, OdfCellRange, OdfCellAddress?)

Adds a named range to this worksheet. 新增命名範圍至此工作表。

public void AddNamedRange(string name, OdfCellRange range, OdfCellAddress? baseCell)

Parameters

name string

The named range's name. / 命名範圍的名稱。

range OdfCellRange

The cell range. / 儲存格範圍。

baseCell OdfCellAddress?

The base cell address. / 基準儲存格位址。

AddSparklineGroup(OdfCellRange?, OdfCellAddress)

Short overload of AddSparklineGroup that accepts dataRange and hostCell; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 dataRange 與 hostCell;其餘可選參數使用預設值並轉呼叫最長 AddSparklineGroup 多載。

public void AddSparklineGroup(OdfCellRange? dataRange, OdfCellAddress hostCell)

Parameters

dataRange OdfCellRange?
hostCell OdfCellAddress

AddSparklineGroup(OdfCellRange?, OdfCellAddress, SparklineType)

Adds a LibreOffice calcext sparkline group to the worksheet. 在工作表中新增 LibreOffice calcext 走勢圖群組。

public void AddSparklineGroup(OdfCellRange? dataRange, OdfCellAddress hostCell, SparklineType type)

Parameters

dataRange OdfCellRange?

The cell range. / 走勢圖資料來源範圍

hostCell OdfCellAddress

The cell address. / 顯示走勢圖的儲存格位址

type SparklineType

The value to use. / 走勢圖類型,預設為折線

Exceptions

ArgumentNullException

Thrown when the documented condition occurs. / 當 dataRange 為 null 時拋出

AddValidationList(OdfCellRange, string, params string[])

Adds list-based data validation and applies it to the specified range. 新增清單型資料驗證,並套用到指定範圍。

public void AddValidationList(OdfCellRange range, string name, params string[] allowedValues)

Parameters

range OdfCellRange

The cell range to apply to. / 要套用的儲存格範圍。

name string

The validation rule name. / 驗證規則名稱。

allowedValues string[]

The allowed values. / 允許的值。

AppendObjects<T>(IEnumerable<T>)

Convenience overload that uses default values for remaining parameters. 便利多載:其餘參數使用預設值並轉呼叫最長多載。

public OdfObjectBindingReport AppendObjects<T>(IEnumerable<T> items)

Parameters

items IEnumerable<T>

Returns

OdfObjectBindingReport

Type Parameters

T

AppendObjects<T>(IEnumerable<T>, OdfObjectBindingOptions?)

Appends public readable object properties after the worksheet used range. 將物件的可讀公開屬性附加到工作表已使用範圍之後。

public OdfObjectBindingReport AppendObjects<T>(IEnumerable<T> items, OdfObjectBindingOptions? options)

Parameters

items IEnumerable<T>

The object sequence to append. / 要附加的物件序列。

options OdfObjectBindingOptions

The object binding options. / 物件繫結選項。

Returns

OdfObjectBindingReport

The object binding report. / 物件繫結報告。

Type Parameters

T

The object type to append. / 要附加的物件型別。

AppendRows(IEnumerable<IEnumerable<object?>>)

Appends rows after the current used range. 將資料列附加到目前已使用範圍之後。

public OdfCellRange AppendRows(IEnumerable<IEnumerable<object?>> rows)

Parameters

rows IEnumerable<IEnumerable<object>>

The row values to append. / 要附加的資料列。

Returns

OdfCellRange

The appended range. / 已附加的範圍。

AppendRows(IEnumerable<IEnumerable<object?>>, int)

Short overload of AppendRows that accepts startColumn; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 startColumn;其餘可選參數使用預設值並轉呼叫最長 AppendRows 多載。

public OdfCellRange AppendRows(IEnumerable<IEnumerable<object?>> rows, int startColumn)

Parameters

rows IEnumerable<IEnumerable<object>>
startColumn int

Returns

OdfCellRange

AppendRows(IEnumerable<IEnumerable<object?>>, int, OdfRangeWriteOptions?)

Appends rows after the current used range and returns a write report. 將資料列附加到目前已使用範圍之後並傳回寫入報告。

public OdfRangeWriteReport AppendRows(IEnumerable<IEnumerable<object?>> rows, int startColumn, OdfRangeWriteOptions? options)

Parameters

rows IEnumerable<IEnumerable<object>>

The row values to append. / 要附加的資料列。

startColumn int

The zero-based start column. / 以 0 為基準的起始欄。

options OdfRangeWriteOptions

The range write options. / 範圍寫入選項。

Returns

OdfRangeWriteReport

The range write report. / 範圍寫入報告。

ApplyStyle(OdfCellRange, string?)

Applies a cell style name to every cell in the specified range. 將儲存格樣式名稱套用至指定範圍內的每個儲存格。

public OdfTableSheet ApplyStyle(OdfCellRange range, string? styleName)

Parameters

range OdfCellRange

The target range. / 目標範圍。

styleName string

The style name to apply. / 要套用的樣式名稱。

Returns

OdfTableSheet

The current worksheet. / 目前工作表。

AutoFilter(OdfCellRange)

Enables autofilter buttons for the specified range. 為指定範圍啟用自動篩選按鈕。

public OdfDatabaseRange AutoFilter(OdfCellRange range)

Parameters

range OdfCellRange

The cell range. / 要啟用自動篩選的儲存格範圍

Returns

OdfDatabaseRange

The result. / 對應的資料庫範圍,可繼續設定篩選條件

AutoFilter(string)

Enables autofilter buttons for the specified range. 為指定範圍啟用自動篩選按鈕。

public OdfDatabaseRange AutoFilter(string range)

Parameters

range string

The cell range. / 要啟用自動篩選的儲存格範圍

Returns

OdfDatabaseRange

The result. / 對應的資料庫範圍,可繼續設定篩選條件

AutoFitColumnWidth(int)

Automatically adjusts the width of the specified column based on its content. 自動調整指定欄的寬度,根據內容長度來適配。

public void AutoFitColumnWidth(int col)

Parameters

col int

The zero-based column index. / 以 0 為基準的欄索引。

ClearPrintArea()

Clears the print area setting. 清除列印範圍設定。

public void ClearPrintArea()

ClearPrintTitleColumns()

Clears the title column setting. 清除標題欄設定。

public void ClearPrintTitleColumns()

ClearPrintTitleRows()

Clears the title row setting. 清除標題列設定。

public void ClearPrintTitleRows()

CopyRows(int, int, int)

Copies the specified row range to the target position. 將指定範圍的列複製到目標位置。

public void CopyRows(int sourcePosition, int count, int targetPosition)

Parameters

sourcePosition int

The numeric value. / 以 0 為基準的來源起始列索引

count int

The numeric value. / 要複製的列數

targetPosition int

The numeric value. / 以 0 為基準的目標插入列索引

CreatePivotTable(OdfCellRange, OdfCellAddress, Action<OdfPivotTableBuilder>)

Creates a strongly typed pivot table and configures its row, column, data, and filter fields with a delegate. 建立強型別樞紐分析表,並以設定委派配置列、欄、資料與篩選欄位。

public OdfNode CreatePivotTable(OdfCellRange sourceRange, OdfCellAddress targetCell, Action<OdfPivotTableBuilder> configure)

Parameters

sourceRange OdfCellRange

The source data range. / 來源資料範圍。

targetCell OdfCellAddress

The pivot table output start cell. / 樞紐分析表輸出起點。

configure Action<OdfPivotTableBuilder>

The delegate used to configure pivot table fields. / 用來設定樞紐分析表欄位的委派。

Returns

OdfNode

The XML node representing the built pivot table. / 代表建置後樞紐分析表的 XML 節點。

Exceptions

ArgumentNullException

Thrown when configure is null. / 當 configurenull 時擲出。

CreatePivotTable(string, OdfCellRange, OdfCellAddress, Action<OdfPivotTableBuilder>)

Creates a strongly typed pivot table and configures its row, column, data, and filter fields with a delegate. 建立強型別樞紐分析表,並以設定委派配置列、欄、資料與篩選欄位。

public OdfNode CreatePivotTable(string name, OdfCellRange sourceRange, OdfCellAddress targetCell, Action<OdfPivotTableBuilder> configure)

Parameters

name string

The pivot table name. / 樞紐分析表名稱。

sourceRange OdfCellRange

The source data range. / 來源資料範圍。

targetCell OdfCellAddress

The pivot table output start cell. / 樞紐分析表輸出起點。

configure Action<OdfPivotTableBuilder>

The delegate used to configure pivot table fields. / 用來設定樞紐分析表欄位的委派。

Returns

OdfNode

The XML node representing the built pivot table. / 代表建置後樞紐分析表的 XML 節點。

Exceptions

ArgumentNullException

Thrown when name or configure is null. / 當 nameconfigurenull 時擲出。

DeleteColumns(int)

Short overload of DeleteColumns that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 DeleteColumns 多載。

public void DeleteColumns(int position)

Parameters

position int

DeleteColumns(int, int)

Deletes columns at the specified position and records table:deletion when change tracking is enabled. 刪除指定位置的欄;若啟用追蹤修訂則記錄 table:deletion

public void DeleteColumns(int position, int count)

Parameters

position int

The numeric value. / 以 0 為基準的起始欄索引

count int

The numeric value. / 要刪除的欄數

DeleteRows(int)

Short overload of DeleteRows that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 DeleteRows 多載。

public void DeleteRows(int position)

Parameters

position int

DeleteRows(int, int)

Deletes rows at the specified position and records table:deletion when change tracking is enabled. 刪除指定位置的列;若啟用追蹤修訂則記錄 table:deletion

public void DeleteRows(int position, int count)

Parameters

position int

The numeric value. / 以 0 為基準的起始列索引

count int

The numeric value. / 要刪除的列數

FreezePanes(int, int)

Freezes the specified number of top rows and left columns. 凍結指定數量的上方列與左側欄。

public void FreezePanes(int frozenRows, int frozenColumns)

Parameters

frozenRows int

The number of rows to freeze. / 要凍結的列數。

frozenColumns int

The number of columns to freeze. / 要凍結的欄數。

Exceptions

ArgumentOutOfRangeException

Thrown when the row or column count is less than 0. / 當列數或欄數小於 0 時擲出。

GetCell(int, int)

Gets the cell at the specified row and column indexes. 取得指定列與欄索引的儲存格。

public OdfCell GetCell(int row, int col)

Parameters

row int

The zero-based row index. / 以 0 為基準的列索引。

col int

The zero-based column index. / 以 0 為基準的欄索引。

Returns

OdfCell

The cell object. / 儲存格物件。

GetCell(string)

Gets the cell at the specified address. 取得指定位址的儲存格。

public OdfCell GetCell(string address)

Parameters

address string

The cell address string (e.g. "A1" or "Sheet1.A1"). / 儲存格位址字串(例如 "A1" 或 "Sheet1.A1")。

Returns

OdfCell

The cell object. / 儲存格物件。

Exceptions

FormatException

Thrown when the cell format is invalid. / 當儲存格格式無效時擲出。

GetColumnWidth(int)

Gets the fixed width of the specified column. 取得指定欄的固定寬度。

public OdfLength? GetColumnWidth(int column)

Parameters

column int

The zero-based column index. / 以 0 為基準的欄索引。

Returns

OdfLength?

The column width; null if not set. / 欄寬度,若未設定則為 null。

GetFormula(string)

Gets the formula for the specified cell. 取得指定儲存格的公式。

public string GetFormula(string address)

Parameters

address string

The cell address. / 儲存格位址,例如 A1

Returns

string

The result. / 指定儲存格的公式;若沒有公式則為空字串

GetFormulaCells()

Gets all used cells with formulas in this worksheet. 取得此工作表中所有含公式的已使用儲存格。

public IEnumerable<OdfFormulaCellInfo> GetFormulaCells()

Returns

IEnumerable<OdfFormulaCellInfo>

The result. / 含公式儲存格資訊列舉

GetFormulaCells(Func<OdfFormulaCellInfo, bool>)

Gets formula cells in this worksheet that match the specified predicate. 取得此工作表中符合指定條件的公式儲存格。

public IEnumerable<OdfFormulaCellInfo> GetFormulaCells(Func<OdfFormulaCellInfo, bool> predicate)

Parameters

predicate Func<OdfFormulaCellInfo, bool>

The delegate to invoke. / 用來篩選公式儲存格的條件委派

Returns

IEnumerable<OdfFormulaCellInfo>

The result. / 符合條件的公式儲存格資訊列舉

GetPrintArea()

Gets the print area, or null when it is not set. 取得列印範圍,若未設定則傳回 null

public OdfCellRange? GetPrintArea()

Returns

OdfCellRange?

GetRange(OdfCellRange)

Gets the cells in the specified range. 取得指定範圍中的儲存格列舉。

public IEnumerable<OdfCell> GetRange(OdfCellRange range)

Parameters

range OdfCellRange

The cell range to enumerate. / 要列舉的儲存格範圍。

Returns

IEnumerable<OdfCell>

The cell enumeration within the range. / 範圍內的儲存格列舉。

GetRowHeight(int)

Gets the fixed height of the specified row. 取得指定列的固定高度。

public OdfLength? GetRowHeight(int row)

Parameters

row int

The zero-based row index. / 以 0 為基準的列索引。

Returns

OdfLength?

The row height; null if not set. / 列高度,若未設定則為 null。

GetUsedCells()

Gets the used cells in this worksheet. 取得此工作表中已使用的儲存格列舉。

public IEnumerable<OdfCell> GetUsedCells()

Returns

IEnumerable<OdfCell>

The used cell enumeration. / 已使用儲存格列舉。

GetUsedRange()

Gets the bounding range that contains all used cells in this worksheet. 取得此工作表所有已使用儲存格的外接範圍。

public OdfCellRange? GetUsedRange()

Returns

OdfCellRange?

The used range, or null when the sheet is empty. / 已使用範圍;工作表為空時傳回 null

GroupColumns(int, int)

Short overload of GroupColumns that accepts startCol and endCol; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 startCol 與 endCol;其餘可選參數使用預設值並轉呼叫最長 GroupColumns 多載。

public void GroupColumns(int startCol, int endCol)

Parameters

startCol int
endCol int

GroupColumns(int, int, bool)

Groups the specified column range as expandable or collapsible. 將指定欄範圍設為可展開/收合的群組。

public void GroupColumns(int startCol, int endCol, bool collapsed)

Parameters

startCol int

The start column index (zero-based). / 起始欄索引(0 為基準)。

endCol int

The end column index, inclusive (zero-based). / 結束欄索引(包含,0 為基準)。

collapsed bool

Whether the group defaults to collapsed. / 是否預設為收合狀態。

GroupRows(int, int)

Short overload of GroupRows that accepts startRow and endRow; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 startRow 與 endRow;其餘可選參數使用預設值並轉呼叫最長 GroupRows 多載。

public void GroupRows(int startRow, int endRow)

Parameters

startRow int
endRow int

GroupRows(int, int, bool)

Groups the specified row range as expandable or collapsible. 將指定列範圍設為可展開/收合的群組。

public void GroupRows(int startRow, int endRow, bool collapsed)

Parameters

startRow int

The start row index (zero-based). / 起始列索引(0 為基準)。

endRow int

The end row index, inclusive (zero-based). / 結束列索引(包含,0 為基準)。

collapsed bool

Whether the group defaults to collapsed. / 是否預設為收合狀態。

InsertChart(OdfCellRange)

Short overload of InsertChart that accepts dataRange; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 dataRange;其餘可選參數使用預設值並轉呼叫最長 InsertChart 多載。

public OdfChartDocument InsertChart(OdfCellRange dataRange)

Parameters

dataRange OdfCellRange

Returns

OdfChartDocument

InsertChart(OdfCellRange, OdfChartType)

Short overload of InsertChart that accepts dataRange and chartType; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 dataRange 與 chartType;其餘可選參數使用預設值並轉呼叫最長 InsertChart 多載。

public OdfChartDocument InsertChart(OdfCellRange dataRange, OdfChartType chartType)

Parameters

dataRange OdfCellRange
chartType OdfChartType

Returns

OdfChartDocument

InsertChart(OdfCellRange, OdfChartType, OdfLength?)

Short overload of InsertChart that accepts dataRange, chartType, and x; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 dataRange、chartType 與 x;其餘可選參數使用預設值並轉呼叫最長 InsertChart 多載。

public OdfChartDocument InsertChart(OdfCellRange dataRange, OdfChartType chartType, OdfLength? x)

Parameters

dataRange OdfCellRange
chartType OdfChartType
x OdfLength?

Returns

OdfChartDocument

InsertChart(OdfCellRange, OdfChartType, OdfLength?, OdfLength?)

Short overload of InsertChart that accepts dataRange, chartType, x, and y; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 dataRange、chartType、x 與 y;其餘可選參數使用預設值並轉呼叫最長 InsertChart 多載。

public OdfChartDocument InsertChart(OdfCellRange dataRange, OdfChartType chartType, OdfLength? x, OdfLength? y)

Parameters

dataRange OdfCellRange
chartType OdfChartType
x OdfLength?
y OdfLength?

Returns

OdfChartDocument

InsertChart(OdfCellRange, OdfChartType, OdfLength?, OdfLength?, OdfLength?)

Short overload of InsertChart that accepts dataRange, chartType, x, y, and width; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 dataRange、chartType、x、y 與 width;其餘可選參數使用預設值並轉呼叫最長 InsertChart 多載。

public OdfChartDocument InsertChart(OdfCellRange dataRange, OdfChartType chartType, OdfLength? x, OdfLength? y, OdfLength? width)

Parameters

dataRange OdfCellRange
chartType OdfChartType
x OdfLength?
y OdfLength?
width OdfLength?

Returns

OdfChartDocument

InsertChart(OdfCellRange, OdfChartType, OdfLength?, OdfLength?, OdfLength?, OdfLength?)

Short overload of InsertChart that accepts dataRange, chartType, x, y, width, and height; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 dataRange、chartType、x、y、width 與 height;其餘可選參數使用預設值並轉呼叫最長 InsertChart 多載。

public OdfChartDocument InsertChart(OdfCellRange dataRange, OdfChartType chartType, OdfLength? x, OdfLength? y, OdfLength? width, OdfLength? height)

Parameters

dataRange OdfCellRange
chartType OdfChartType
x OdfLength?
y OdfLength?
width OdfLength?
height OdfLength?

Returns

OdfChartDocument

InsertChart(OdfCellRange, OdfChartType, OdfLength?, OdfLength?, OdfLength?, OdfLength?, bool)

Short overload of InsertChart that accepts dataRange, chartType, x, y, width, height, and firstRowAsHeader; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 dataRange、chartType、x、y、width、height 與 firstRowAsHeader;其餘可選參數使用預設值並轉呼叫最長 InsertChart 多載。

public OdfChartDocument InsertChart(OdfCellRange dataRange, OdfChartType chartType, OdfLength? x, OdfLength? y, OdfLength? width, OdfLength? height, bool firstRowAsHeader)

Parameters

dataRange OdfCellRange
chartType OdfChartType
x OdfLength?
y OdfLength?
width OdfLength?
height OdfLength?
firstRowAsHeader bool

Returns

OdfChartDocument

InsertChart(OdfCellRange, OdfChartType, OdfLength?, OdfLength?, OdfLength?, OdfLength?, bool, bool)

Inserts a chart bound to cell range data into this worksheet. 在此工作表中插入一個與儲存格範圍資料繫結的圖表。

public OdfChartDocument InsertChart(OdfCellRange dataRange, OdfChartType chartType, OdfLength? x, OdfLength? y, OdfLength? width, OdfLength? height, bool firstRowAsHeader, bool firstColumnAsLabel)

Parameters

dataRange OdfCellRange

The cell range bound to the data. / 資料繫結的儲存格範圍。

chartType OdfChartType

The chart type, defaulting to a bar chart. / 圖表類型,預設為條形圖。

x OdfLength?

The chart frame's left margin, defaulting to 1cm. / 圖表框左邊距,預設 1cm。

y OdfLength?

The chart frame's top margin, defaulting to 1cm. / 圖表框上邊距,預設 1cm。

width OdfLength?

The chart frame's width, defaulting to 12cm. / 圖表框寬度,預設 12cm。

height OdfLength?

The chart frame's height, defaulting to 7cm. / 圖表框高度,預設 7cm。

firstRowAsHeader bool

Whether the first data row is treated as the series header, defaulting to true. / 資料首列作為序列標題,預設 true。

firstColumnAsLabel bool

Whether the first data column is treated as the X-axis category label, defaulting to true. / 資料首欄作為 X 軸分類標籤,預設 true。

Returns

OdfChartDocument

可進一步設定的 OdfChartDocument。 呼叫端修改後可直接儲存父文件,父文件會自動 flush 已追蹤的嵌入圖表; 也可手動呼叫 Save() 以提早寫回封裝。 請勿對此物件呼叫 Dispose()(生命週期由父文件管理)。

InsertColumnPageBreak(int)

Inserts a manual column page break after the specified column. 在指定欄之後插入手動欄分頁符。

public void InsertColumnPageBreak(int afterCol)

Parameters

afterCol int

The numeric value. / 分頁符位於此欄之後(0 為基準)

InsertColumns(int)

Short overload of InsertColumns that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 InsertColumns 多載。

public void InsertColumns(int position)

Parameters

position int

InsertColumns(int, int)

Inserts columns at the specified position and records table:insertion when change tracking is enabled. 於指定位置插入欄;若啟用追蹤修訂則記錄 table:insertion

public void InsertColumns(int position, int count)

Parameters

position int

The numeric value. / 以 0 為基準的插入欄索引

count int

The numeric value. / 要插入的欄數

InsertRowPageBreak(int)

Inserts a manual row page break after the specified row. 在指定列之後插入手動列分頁符。

public void InsertRowPageBreak(int afterRow)

Parameters

afterRow int

The numeric value. / 分頁符位於此列之後(0 為基準)

InsertRows(int)

Short overload of InsertRows that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 InsertRows 多載。

public void InsertRows(int position)

Parameters

position int

InsertRows(int, int)

Inserts rows at the specified position and records table:insertion when change tracking is enabled. 於指定位置插入列;若啟用追蹤修訂則記錄 table:insertion

public void InsertRows(int position, int count)

Parameters

position int

The numeric value. / 以 0 為基準的插入列索引

count int

The numeric value. / 要插入的列數

IsColumnVisible(int)

Determines whether the specified column is visible. 判斷指定欄是否可見。

public bool IsColumnVisible(int col)

Parameters

col int

The zero-based column index. / 以 0 為基準的欄索引。

Returns

bool

true if visible; otherwise false. / 若顯示則為 true,否則為 false。

IsRowOptimalHeight(int)

Determines whether the specified row uses optimal automatic height. 判斷指定列是否啟用最佳自動列高。

public bool IsRowOptimalHeight(int row)

Parameters

row int

The zero-based row index. / 以 0 為基準的列索引。

Returns

bool

Whether it is enabled. / 是否啟用。

IsRowVisible(int)

Determines whether the specified row is visible. 判斷指定列是否可見。

public bool IsRowVisible(int row)

Parameters

row int

The zero-based row index. / 以 0 為基準的列索引。

Returns

bool

true if visible; otherwise false. / 若顯示則為 true,否則為 false。

MergeCells(OdfCellRange)

Short overload of MergeCells that accepts range; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 range;其餘可選參數使用預設值並轉呼叫最長 MergeCells 多載。

public void MergeCells(OdfCellRange range)

Parameters

range OdfCellRange

MergeCells(OdfCellRange, OdfBorder?)

Merges the specified cell range and optionally applies an outer border. 合併指定的儲存格範圍,並可選擇性套用外框線。

public void MergeCells(OdfCellRange range, OdfBorder? outerBorder)

Parameters

range OdfCellRange

The cell range. / 儲存格範圍。

outerBorder OdfBorder?

The border format applied to the outside of the merged range. / 套用於合併範圍外部的外框線格式。

MoveCell(int, int, int, int)

Moves cell content from the source address to the target address and records table:movement when change tracking is enabled. 將儲存格內容由來源位址移至目標位址;若啟用追蹤修訂則記錄 table:movement

public void MoveCell(int sourceRow, int sourceColumn, int targetRow, int targetColumn)

Parameters

sourceRow int

The numeric value. / 來源列索引(以 0 為基準)

sourceColumn int

The numeric value. / 來源欄索引(以 0 為基準)

targetRow int

The numeric value. / 目標列索引(以 0 為基準)

targetColumn int

The numeric value. / 目標欄索引(以 0 為基準)

MoveRows(int, int, int)

Moves the specified row range to the target position, using the table state after the source rows are removed. 將指定範圍的列移動到目標位置;目標索引以移除來源列後的表格狀態為準。

public void MoveRows(int sourcePosition, int count, int targetPosition)

Parameters

sourcePosition int

The numeric value. / 以 0 為基準的來源起始列索引

count int

The numeric value. / 要移動的列數

targetPosition int

The numeric value. / 移除來源列後,以 0 為基準的目標插入列索引

Protect(string)

Enables worksheet protection and stores the hashed password. 啟用工作表保護,並設定雜湊後的密碼。

public void Protect(string password)

Parameters

password string

The plain text password. / 密碼明文。

PruneAndCollect()

Short overload of PruneAndCollect that uses default values for all optional parameters and forwards to the full overload. 便利多載:PruneAndCollect 的所有可選參數使用預設值並轉呼叫最長多載。

public int PruneAndCollect()

Returns

int

PruneAndCollect(bool)

Prunes this worksheet from the spreadsheet DOM tree and releases its subtree references. 將此工作表從試算表 DOM 樹中剪裁,並釋放其子樹與延遲載入 XML 參照。

public int PruneAndCollect(bool collectGarbage)

Parameters

collectGarbage bool

Whether to request an optimized GC collection after pruning. / 是否在剪裁後要求執行一次最佳化 GC 收集。

Returns

int

The number of pruned nodes, including the worksheet node itself. / 已剪裁的節點數,包含工作表節點本身。

ReadObjects<T>(OdfCellRange)

Convenience overload that uses default values for remaining parameters. 便利多載:其餘參數使用預設值並轉呼叫最長多載。

public IReadOnlyList<T> ReadObjects<T>(OdfCellRange range) where T : new()

Parameters

range OdfCellRange

Returns

IReadOnlyList<T>

Type Parameters

T

ReadObjects<T>(OdfCellRange, OdfObjectReadOptions?)

Reads worksheet rows into objects using the header row as the property map. 使用標題列作為屬性對應,將工作表資料列讀成物件。

public IReadOnlyList<T> ReadObjects<T>(OdfCellRange range, OdfObjectReadOptions? options) where T : new()

Parameters

range OdfCellRange

The source cell range. / 來源儲存格範圍。

options OdfObjectReadOptions

The object read options. / 物件讀取選項。

Returns

IReadOnlyList<T>

The materialized object list. / 具體化後的物件清單。

Type Parameters

T

The object type to create. / 要建立的物件型別。

ReleaseFacadeCaches()

Releases cached high-level collection facades while preserving the underlying DOM and document content. 釋放此工作表已建立的高階集合 facade 快取,但保留底層 DOM 與文件內容不變。

public void ReleaseFacadeCaches()

Remarks

適合在處理大型工作表後主動解除 CellsRowsColumnsRanges 的入口物件參照,降低長時間批次流程的 wrapper 物件保留量。後續再次存取這些屬性時會按需重新建立 facade。

RemoveColumnPageBreak(int)

Removes the manual page break for the specified column. 移除指定欄的手動分頁符。

public bool RemoveColumnPageBreak(int afterCol)

Parameters

afterCol int

The zero-based column index after which the page break is located. / 分頁符位於此欄之後(0 為基準)。

Returns

bool

true if the page break was removed; otherwise, false. / 若已移除分頁符則為 true;否則為 false

RemoveRowPageBreak(int)

Removes the manual page break for the specified row. 移除指定列的手動分頁符。

public bool RemoveRowPageBreak(int afterRow)

Parameters

afterRow int

The zero-based row index after which the page break is located. / 分頁符位於此列之後(0 為基準)。

Returns

bool

true if the page break was removed; otherwise, false. / 若已移除分頁符則為 true;否則為 false

ReplaceFormulaText(string, string)

Short overload of ReplaceFormulaText that accepts oldValue and newValue; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 oldValue 與 newValue;其餘可選參數使用預設值並轉呼叫最長 ReplaceFormulaText 多載。

public int ReplaceFormulaText(string oldValue, string newValue)

Parameters

oldValue string
newValue string

Returns

int

ReplaceFormulaText(string, string, StringComparison)

Replaces the specified text in all formulas in this worksheet. 取代此工作表所有公式中的指定文字。

public int ReplaceFormulaText(string oldValue, string newValue, StringComparison comparisonType)

Parameters

oldValue string

The value to use. / 要尋找的文字

newValue string

The value to use. / 替換後的文字

comparisonType StringComparison

The value to use. / 文字比對方式

Returns

int

The result. / 實際變更的公式數量

SetColumnVisible(int, bool)

Sets whether the specified column is visible. 設定指定欄是否可見。

public void SetColumnVisible(int col, bool visible)

Parameters

col int

The zero-based column index. / 以 0 為基準的欄索引。

visible bool

Whether to show it. / 是否顯示。

SetColumnWidth(int, OdfLength)

Sets the width of the specified column. 設定指定欄的寬度。

public void SetColumnWidth(int col, OdfLength width)

Parameters

col int

The zero-based column index. / 以 0 為基準的欄索引。

width OdfLength

The column width. / 欄寬度。

SetFitToPage()

Short overload of SetFitToPage that uses default values for all optional parameters and forwards to the full overload. 便利多載:SetFitToPage 的所有可選參數使用預設值並轉呼叫最長多載。

public void SetFitToPage()

SetFitToPage(int)

Short overload of SetFitToPage that accepts maxPagesWide; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 maxPagesWide;其餘可選參數使用預設值並轉呼叫最長 SetFitToPage 多載。

public void SetFitToPage(int maxPagesWide)

Parameters

maxPagesWide int

SetFitToPage(int, int)

Sets scaling to fit within the specified page count. 設定縮放以適合指定頁數。

public void SetFitToPage(int maxPagesWide, int maxPagesTall)

Parameters

maxPagesWide int

The numeric value. / 最大橫向頁數(0 代表不限制)

maxPagesTall int

The numeric value. / 最大縱向頁數(0 代表不限制)

SetFormula(string, string)

Sets the formula for the specified cell. 設定指定儲存格的公式。

public OdfCell SetFormula(string address, string formula)

Parameters

address string

The cell address. / 儲存格位址,例如 A1

formula string

The value to use. / 要寫入的公式;傳入空字串會清除公式

Returns

OdfCell

The result. / 已更新的儲存格 facade

SetFormula(string, string, object?)

Sets the formula and cached value for the specified cell. 設定指定儲存格的公式與快取值。

public OdfCell SetFormula(string address, string formula, object? cachedValue)

Parameters

address string

The cell address. / 儲存格位址,例如 A1

formula string

The ODF formula text; an empty value clears the formula. / ODF 公式文字;空值會清除公式。

cachedValue object

The cached value stored with the formula. / 隨公式儲存的快取值。

Returns

OdfCell

The updated cell facade. / 已更新的儲存格 facade。

SetPrintArea(OdfCellRange)

Sets the print area. 設定列印範圍。

public void SetPrintArea(OdfCellRange range)

Parameters

range OdfCellRange

The cell range. / 列印範圍

SetPrintScale(int)

Sets the print scale percentage from 1 to 400, or 0 to restore automatic scaling. 設定列印縮放比例(1–400),傳入 0 代表恢復自動。

public void SetPrintScale(int percent)

Parameters

percent int

The numeric value. / 縮放比例(百分比)

SetPrintTitleColumns(int, int)

Sets title columns that repeat on each printed page. 設定標題欄(列印時每頁重複的欄)。

public void SetPrintTitleColumns(int startCol, int endCol)

Parameters

startCol int

The numeric value. / 起始欄索引(0 為基準)

endCol int

The numeric value. / 結束欄索引(包含,0 為基準)

SetPrintTitleRows(int, int)

Sets title rows that repeat on each printed page. 設定標題列(列印時每頁重複的列)。

public void SetPrintTitleRows(int startRow, int endRow)

Parameters

startRow int

The numeric value. / 起始列索引(0 為基準)

endRow int

The numeric value. / 結束列索引(包含,0 為基準)

SetRowHeight(int, OdfLength?)

Sets the fixed height of the specified row. 設定指定列的固定高度。

public void SetRowHeight(int row, OdfLength? height)

Parameters

row int

The zero-based row index. / 以 0 為基準的列索引。

height OdfLength?

The row height. / 列高度。

SetRowOptimalHeight(int, bool)

Sets whether the specified row uses optimal automatic height. 設定指定列是否啟用最佳自動列高 (AutoHeight)。

public void SetRowOptimalHeight(int row, bool useOptimal)

Parameters

row int

The zero-based row index. / 以 0 為基準的列索引。

useOptimal bool

Whether to enable it. / 是否啟用。

SetRowVisible(int, bool)

Sets whether the specified row is visible. 設定指定列是否可見。

public void SetRowVisible(int row, bool visible)

Parameters

row int

The zero-based row index. / 以 0 為基準的列索引。

visible bool

Whether to show it. / 是否顯示。

SetValues(OdfCellAddress, IEnumerable<IEnumerable<object?>>)

Sets rows of values starting at the specified cell. 從指定儲存格開始逐列設定資料。

public OdfCellRange SetValues(OdfCellAddress startAddress, IEnumerable<IEnumerable<object?>> rows)

Parameters

startAddress OdfCellAddress

The top-left target cell. / 左上角目標儲存格。

rows IEnumerable<IEnumerable<object>>

The row values to write. / 要寫入的資料列。

Returns

OdfCellRange

The updated range. / 已更新的範圍。

SetValues(OdfCellAddress, IEnumerable<IEnumerable<object?>>, OdfRangeWriteOptions?)

Sets rows of values starting at the specified cell and returns a write report. 從指定儲存格開始逐列設定資料並傳回寫入報告。

public OdfRangeWriteReport SetValues(OdfCellAddress startAddress, IEnumerable<IEnumerable<object?>> rows, OdfRangeWriteOptions? options)

Parameters

startAddress OdfCellAddress

The top-left target cell. / 左上角目標儲存格。

rows IEnumerable<IEnumerable<object>>

The row values to write. / 要寫入的資料列。

options OdfRangeWriteOptions

The range write options. / 範圍寫入選項。

Returns

OdfRangeWriteReport

The range write report. / 範圍寫入報告。

SetValues(OdfCellAddress, object?[,])

Sets a rectangular block of values starting at the specified cell. 從指定儲存格開始設定一個矩形資料區塊。

public OdfCellRange SetValues(OdfCellAddress startAddress, object?[,] values)

Parameters

startAddress OdfCellAddress
values object[,]

Returns

OdfCellRange

The updated range. / 已更新的範圍。

SetValues(OdfCellAddress, object?[,], OdfRangeWriteOptions?)

Sets a rectangular block of values and returns a write report. 設定一個矩形資料區塊並傳回寫入報告。

public OdfRangeWriteReport SetValues(OdfCellAddress startAddress, object?[,] values, OdfRangeWriteOptions? options)

Parameters

startAddress OdfCellAddress
values object[,]
options OdfRangeWriteOptions

Returns

OdfRangeWriteReport

The range write report. / 範圍寫入報告。

Sort(OdfCellRange, params (int fieldNumber, bool ascending)[])

Sets sort rules for the specified range. 為指定範圍設定排序規則。

public OdfDatabaseRange Sort(OdfCellRange range, params (int fieldNumber, bool ascending)[] rules)

Parameters

range OdfCellRange

The cell range. / 要排序的儲存格範圍

rules (int fieldNumber, bool ascending)[]

The value to use. / 排序規則陣列,包含欄位編號與是否遞增

Returns

OdfDatabaseRange

The result. / 對應的資料庫範圍

Sort(string, params (int fieldNumber, bool ascending)[])

Sets sort rules for the specified range. 為指定範圍設定排序規則。

public OdfDatabaseRange Sort(string range, params (int fieldNumber, bool ascending)[] rules)

Parameters

range string

The cell range. / 要排序的儲存格範圍

rules (int fieldNumber, bool ascending)[]

The value to use. / 排序規則陣列,包含欄位編號與是否遞增

Returns

OdfDatabaseRange

The result. / 對應的資料庫範圍

SplitPanes(int, int)

Splits worksheet panes in split mode, without freezing. 以分割模式(非凍結)分割工作表窗格。

public void SplitPanes(int splitRow, int splitColumn)

Parameters

splitRow int

The row index of the horizontal split line (0 means no split). / 水平分割線所在的列索引(0 表示不分割)。

splitColumn int

The column index of the vertical split line (0 means no split). / 垂直分割線所在的欄索引(0 表示不分割)。

Exceptions

ArgumentOutOfRangeException

Thrown when the row or column index is less than 0. / 當列索引或欄索引小於 0 時拋出。

SplitWindow(int, int)

Splits the worksheet window in split mode, without freezing. 以分割模式(非凍結)分割工作表視窗。

public void SplitWindow(int splitRow, int splitColumn)

Parameters

splitRow int

The row index of the horizontal split line (0 means no split). / 水平分割線所在的列索引(0 表示不分割)。

splitColumn int

The column index of the vertical split line (0 means no split). / 垂直分割線所在的欄索引(0 表示不分割)。

Exceptions

ArgumentOutOfRangeException

Thrown when the row or column index is less than 0. / 當列索引或欄索引小於 0 時擲出。

TryGetFormula(string, out string)

Attempts to get the formula for the specified cell. 嘗試取得指定儲存格的公式。

public bool TryGetFormula(string address, out string formula)

Parameters

address string

The cell address. / 儲存格位址,例如 A1

formula string

The value to use. / 取得成功時傳回公式文字

Returns

bool

The result. / 若指定儲存格具有公式則為 true,否則為 false

TryUnprotect(string)

Attempts to disable worksheet protection with the specified password. 嘗試以指定密碼解除工作表保護。

public bool TryUnprotect(string password)

Parameters

password string

The plain text password. / 密碼明文。

Returns

bool

true if unprotection succeeds; otherwise false. / 若解除成功則為 true,否則為 false。

UngroupColumns(int, int)

Ungroups the specified column range and moves the columns back to the worksheet body. 移除包含指定欄範圍的群組,將欄移回工作表主體。

public void UngroupColumns(int startCol, int endCol)

Parameters

startCol int

The start column index (zero-based). / 起始欄索引(0 為基準)。

endCol int

The end column index, inclusive (zero-based). / 結束欄索引(包含,0 為基準)。

UngroupRows(int, int)

Ungroups the specified row range and moves the rows back to the worksheet body. 移除包含指定列範圍的群組,將列移回工作表主體。

public void UngroupRows(int startRow, int endRow)

Parameters

startRow int

The start row index (zero-based). / 起始列索引(0 為基準)。

endRow int

The end row index, inclusive (zero-based). / 結束列索引(包含,0 為基準)。

UnmergeCells(OdfCellRange)

Unmerges the specified cell range. 取消合併指定的儲存格範圍。

public void UnmergeCells(OdfCellRange range)

Parameters

range OdfCellRange

The cell range. / 要取消合併的儲存格範圍。

UnmergeCells(string)

Unmerges the specified Excel-style cell range. 取消合併指定的 Excel 樣式儲存格範圍。

public void UnmergeCells(string rangeAddress)

Parameters

rangeAddress string

The cell range. / 儲存格範圍位址,例如 A1:C3

Unprotect()

Disables worksheet protection. 解除工作表保護。

public void Unprotect()

UpdateFormulas(Func<OdfFormulaCellInfo, string?>)

Updates formulas in this worksheet. 更新此工作表中的公式。

public int UpdateFormulas(Func<OdfFormulaCellInfo, string?> updater)

Parameters

updater Func<OdfFormulaCellInfo, string>

The delegate to invoke. / 接收目前公式資訊並傳回新公式的委派;傳回 null 表示不變更

Returns

int

The result. / 實際變更的公式數量

UpdateObjects<T>(OdfCellRange, IEnumerable<T>, OdfObjectUpdateOptions)

Updates existing object-bound rows by key without inserting new rows. 依 key 更新既有物件繫結資料列且不新增資料列。

public OdfObjectBindingReport UpdateObjects<T>(OdfCellRange range, IEnumerable<T> items, OdfObjectUpdateOptions options)

Parameters

range OdfCellRange

The target table range. / 目標資料表範圍。

items IEnumerable<T>

The object sequence to update. / 要更新的物件序列。

options OdfObjectUpdateOptions

The update options. / 更新選項。

Returns

OdfObjectBindingReport

The object binding report. / 物件繫結報告。

Type Parameters

T

The object type to update. / 要更新的物件型別。

UpdateRows(OdfCellRange, IEnumerable<IEnumerable<object?>>)

Updates rows inside the specified range from top to bottom. 由上而下更新指定範圍內的資料列。

public OdfCellRange UpdateRows(OdfCellRange range, IEnumerable<IEnumerable<object?>> rows)

Parameters

range OdfCellRange

The target range. / 目標範圍。

rows IEnumerable<IEnumerable<object>>

The row values to write. / 要寫入的資料列。

Returns

OdfCellRange

The updated range. / 已更新的範圍。

UpdateRows(OdfCellRange, IEnumerable<IEnumerable<object?>>, OdfRangeWriteOptions?)

Updates rows inside the specified range and returns a write report. 更新指定範圍內的資料列並傳回寫入報告。

public OdfRangeWriteReport UpdateRows(OdfCellRange range, IEnumerable<IEnumerable<object?>> rows, OdfRangeWriteOptions? options)

Parameters

range OdfCellRange

The target range. / 目標範圍。

rows IEnumerable<IEnumerable<object>>

The row values to write. / 要寫入的資料列。

options OdfRangeWriteOptions

The range write options. / 範圍寫入選項。

Returns

OdfRangeWriteReport

The range write report. / 範圍寫入報告。

UpsertObjects<T>(OdfCellRange, IEnumerable<T>, OdfObjectUpdateOptions)

Updates object-bound rows by key and inserts rows for missing keys. 依 key 更新物件繫結資料列,並針對缺少的 key 新增資料列。

public OdfObjectBindingReport UpsertObjects<T>(OdfCellRange range, IEnumerable<T> items, OdfObjectUpdateOptions options)

Parameters

range OdfCellRange

The target table range. / 目標資料表範圍。

items IEnumerable<T>

The object sequence to upsert. / 要 upsert 的物件序列。

options OdfObjectUpdateOptions

The update options. / 更新選項。

Returns

OdfObjectBindingReport

The object binding report. / 物件繫結報告。

Type Parameters

T

The object type to upsert. / 要 upsert 的物件型別。

ValidateObjectBinding<T>(OdfCellRange)

Convenience overload that uses default values for remaining parameters. 便利多載:其餘參數使用預設值並轉呼叫最長多載。

public OdfObjectBindingValidationReport ValidateObjectBinding<T>(OdfCellRange range) where T : new()

Parameters

range OdfCellRange

Returns

OdfObjectBindingValidationReport

Type Parameters

T

ValidateObjectBinding<T>(OdfCellRange, OdfObjectReadOptions?)

Validates whether a spreadsheet range can be bound to the specified object type. 驗證試算表範圍是否可繫結至指定物件型別。

public OdfObjectBindingValidationReport ValidateObjectBinding<T>(OdfCellRange range, OdfObjectReadOptions? options) where T : new()

Parameters

range OdfCellRange

The source cell range. / 來源儲存格範圍。

options OdfObjectReadOptions

The validation options. / 驗證選項。

Returns

OdfObjectBindingValidationReport

The validation report. / 驗證報告。

Type Parameters

T

The object type to validate. / 要驗證的物件型別。

VerifyPassword(string)

Verifies whether the worksheet protection password is valid. 驗證工作表保護密碼是否正確。

public bool VerifyPassword(string password)

Parameters

password string

The password to verify. / 要驗證的密碼。

Returns

bool

true if verification succeeds; otherwise false. / 若驗證成功則為 true,否則為 false。

WriteObjects<T>(OdfCellAddress, IEnumerable<T>)

Convenience overload that uses default values for remaining parameters. 便利多載:其餘參數使用預設值並轉呼叫最長多載。

public OdfObjectBindingReport WriteObjects<T>(OdfCellAddress startAddress, IEnumerable<T> items)

Parameters

startAddress OdfCellAddress
items IEnumerable<T>

Returns

OdfObjectBindingReport

Type Parameters

T

WriteObjects<T>(OdfCellAddress, IEnumerable<T>, OdfObjectBindingOptions?)

Writes public readable object properties into this worksheet. 將物件的可讀公開屬性寫入此工作表。

public OdfObjectBindingReport WriteObjects<T>(OdfCellAddress startAddress, IEnumerable<T> items, OdfObjectBindingOptions? options)

Parameters

startAddress OdfCellAddress

The top-left target cell. / 左上角目標儲存格。

items IEnumerable<T>

The object sequence to write. / 要寫入的物件序列。

options OdfObjectBindingOptions

The object binding options. / 物件繫結選項。

Returns

OdfObjectBindingReport

The object binding report. / 物件繫結報告。

Type Parameters

T

The object type to write. / 要寫入的物件型別。