NanoXLSX.Compatibility 3.2.0
Loading...
Searching...
No Matches
NanoXLSX.ExternalLinkBuilder Class Reference

Provides a fluent API for defining worksheets and cached cell values of an external workbook link. More...

Public Member Functions

 ExternalLinkBuilder (string absoluteUri, string relativeUri=null)
 Constructor with mandatory absolute URI and optional relative URI.
ExternalLink Build ()
 Returns the configured external workbook link.
ExternalLinkBuilder AddWorksheet (string name)
 Adds a worksheet to the external workbook definition and marks it as currently used worksheet in the builder. as the current worksheet.
ExternalLinkBuilder UseWorksheet (string name)
 Selects an already declared external worksheet. The worksheet will be marked as currently used worksheet in the builder.
ExternalLinkBuilder AddCell (string address, string value)
 Adds or replaces a cached cell value (string representation) on the current worksheet.
ExternalLinkBuilder AddCell (string address, string value, ExternalCellValue.DataType type)
 Adds or replaces a cached cell value with specified type on the current worksheet.

Detailed Description

Provides a fluent API for defining worksheets and cached cell values of an external workbook link.

Definition at line 17 of file ExternalLinkBuilder.cs.

Constructor & Destructor Documentation

◆ ExternalLinkBuilder()

NanoXLSX.ExternalLinkBuilder.ExternalLinkBuilder ( string absoluteUri,
string relativeUri = null )

Constructor with mandatory absolute URI and optional relative URI.

Parameters
absoluteUriAbsolute URI
relativeUriRelative URI, default is null

Definition at line 27 of file ExternalLinkBuilder.cs.

Member Function Documentation

◆ AddCell() [1/2]

ExternalLinkBuilder NanoXLSX.ExternalLinkBuilder.AddCell ( string address,
string value )

Adds or replaces a cached cell value (string representation) on the current worksheet.

Parameters
addressAddress of the cell
valueValue as string representation. Null will be transformed to the type DataType.Empty. The cached value will be an empty string in this case
Exceptions
ArgumentExceptionThrown if a boolean value is not represented as "0" or "1".

\Remark

The validity of numeric values is not checked. Boolean values must be represented as "0" or "1". The type DataType.Empty discards the passed value.

Definition at line 86 of file ExternalLinkBuilder.cs.

◆ AddCell() [2/2]

ExternalLinkBuilder NanoXLSX.ExternalLinkBuilder.AddCell ( string address,
string value,
ExternalCellValue.DataType type )

Adds or replaces a cached cell value with specified type on the current worksheet.

Parameters
addressAddress of the cell
valueValue as string representation. Null will be transformed to the type DataType.Empty. The cached value will be an empty string in this case
typeType of the external cell
Exceptions
ArgumentExceptionThrown if a boolean value is not represented as "0" or "1".

\Remark

The validity of numeric values is not checked. Boolean values must be represented as "0" or "1". The type DataType.Empty discards the passed value.

Definition at line 104 of file ExternalLinkBuilder.cs.

◆ AddWorksheet()

ExternalLinkBuilder NanoXLSX.ExternalLinkBuilder.AddWorksheet ( string name)

Adds a worksheet to the external workbook definition and marks it as currently used worksheet in the builder. as the current worksheet.

Exceptions
Exceptions.FormatExceptionThrown if the given name is not a valid worksheet name

Definition at line 57 of file ExternalLinkBuilder.cs.

◆ Build()

ExternalLink NanoXLSX.ExternalLinkBuilder.Build ( )

Returns the configured external workbook link.

Returns
Returns the external link object with added worksheets, defined names and cells

Definition at line 47 of file ExternalLinkBuilder.cs.

◆ UseWorksheet()

ExternalLinkBuilder NanoXLSX.ExternalLinkBuilder.UseWorksheet ( string name)

Selects an already declared external worksheet. The worksheet will be marked as currently used worksheet in the builder.

Parameters
nameName of the external worksheet to use

Definition at line 71 of file ExternalLinkBuilder.cs.


The documentation for this class was generated from the following file: