Header menu logo FsSpreadsheet

Table Module

Functions for working with tables. The table object itself just stores the name, the headers and the area in which the table lies. The values are stored in the sheetData object associated with the same worksheet as the table. Therefore, in order to work with tables, one should retrieve both the sheetData and the table. The value retrieval functions ask for both.

Nested modules

Modules Description

Area

The areas marks the area in which the table lies.

TableColumn

Functions for working with a single tableColumn of a table.

TableColumns

Functions for working with the columns of a table.

Functions and values

Function or value Description

addTable workbookPart worksheetPart table

Full Usage: addTable workbookPart worksheetPart table

Parameters:
Returns: WorksheetPart

Adds a table to the worksheetPart.

workbookPart : WorkbookPart
worksheetPart : WorksheetPart
table : Table
Returns: WorksheetPart

create displayName area tableColumns

Full Usage: create displayName area tableColumns

Parameters:
Returns: Table

Creates a table from a name a area and tableColumns.

displayName : string
area : StringValue
tableColumns : TableColumn seq
Returns: Table

getArea table

Full Usage: getArea table

Parameters:
Returns: StringValue

Gets the area of the table.

table : Table
Returns: StringValue

getByNameBy predicate worksheetPart

Full Usage: getByNameBy predicate worksheetPart

Parameters:
Returns: Table

Returns a table for which the predicate applied to its name returns true.

predicate : string -> bool
worksheetPart : WorksheetPart
Returns: Table

getColumnHeaders table

Full Usage: getColumnHeaders table

Parameters:
Returns: string seq

Returns the headers of the columns.

table : Table
Returns: string seq

getDisplayName table

Full Usage: getDisplayName table

Parameters:
Returns: string

Gets the diplayName of a table.

table : Table
Returns: string

getName table

Full Usage: getName table

Parameters:
Returns: string

Gets the name of a table.

table : Table
Returns: string

list worksheetPart

Full Usage: list worksheetPart

Parameters:
Returns: Table seq

List all tables contained in the worksheet.

worksheetPart : WorksheetPart
Returns: Table seq

setArea area table

Full Usage: setArea area table

Parameters:

Sets the area of the table.

area : StringValue
table : Table

setDisplayName displayName table

Full Usage: setDisplayName displayName table

Parameters:
    displayName : string
    table : Table

Returns: Table

Sets the displayName of the table.

displayName : string
table : Table
Returns: Table

setName name table

Full Usage: setName name table

Parameters:
    name : string
    table : Table

Returns: Table

Sets the name of a table.

name : string
table : Table
Returns: Table

toSparseValueMatrix sst sheetData table

Full Usage: toSparseValueMatrix sst sheetData table

Parameters:
Returns: Dictionary<(int * string), string>

Reads a complete table. Values are stored sparsely in a dictionary, with the key being a row index and column header tuple.

sst : Option<SST>
sheetData : SheetData
table : Table
Returns: Dictionary<(int * string), string>

tryCreateWithExistingHeaders sst sheetData name area

Full Usage: tryCreateWithExistingHeaders sst sheetData name area

Parameters:
Returns: Table option

Create a table object by an area. If the first row of this area contains values in the given sheet, these are chosen as headers for the table and a table is returned.

sst : Option<SST>
sheetData : SheetData
name : string
area : StringValue
Returns: Table option

tryGetByNameBy predicate worksheetPart

Full Usage: tryGetByNameBy predicate worksheetPart

Parameters:
Returns: Table option

If a table exists, for which the predicate applied to its name returns true, gets it. Else returns None.

predicate : string -> bool
worksheetPart : WorksheetPart
Returns: Table option

tryGetColumnValuesByColumnHeader sst sheetData columnHeader table

Full Usage: tryGetColumnValuesByColumnHeader sst sheetData columnHeader table

Parameters:
Returns: string list option

If a column with the given header exists in the table, returns its values. Else returns None.

sst : Option<SST>
sheetData : SheetData
columnHeader : string
table : Table
Returns: string list option

tryGetFirst worksheetPart

Full Usage: tryGetFirst worksheetPart

Parameters:
Returns: Table option

If the worksheetPart contains tables, returns the first one. Else returns None.

worksheetPart : WorksheetPart
Returns: Table option

tryGetIndexedColumnValuesByColumnHeader sst sheetData columnHeader table

Full Usage: tryGetIndexedColumnValuesByColumnHeader sst sheetData columnHeader table

Parameters:
Returns: (int * string) list option

If a column with the given header exists in the table, returns its indexed values. Else returns None.

sst : Option<SST>
sheetData : SheetData
columnHeader : string
table : Table
Returns: (int * string) list option

tryGetKeyValuesByColumnHeaders sst sheetData keyColHeader valColHeader defaultValue table

Full Usage: tryGetKeyValuesByColumnHeaders sst sheetData keyColHeader valColHeader defaultValue table

Parameters:
    sst : Option<SST>
    sheetData : SheetData
    keyColHeader : string
    valColHeader : string
    defaultValue : string
    table : Table

Returns: (string * string) list option

If a key column and a value with the given header exist in the table, returns a tuple list of keys and values (else returns None). Missing values get replaced with the given default value.

sst : Option<SST>
sheetData : SheetData
keyColHeader : string
valColHeader : string
defaultValue : string
table : Table
Returns: (string * string) list option

tryGetTableColumnBy predicate table

Full Usage: tryGetTableColumnBy predicate table

Parameters:
Returns: TableColumn option

Returns the tableColumn for which the predicate returns true if it exists. Else returns None.

predicate : TableColumn -> bool
table : Table
Returns: TableColumn option

tryGetTableColumnByName name table

Full Usage: tryGetTableColumnByName name table

Parameters:
    name : string
    table : Table

Returns: TableColumn option

If a tableColumn with the given name exists in the table, returns it. Else returns None.

name : string
table : Table
Returns: TableColumn option

Type something to start searching.