NanoXLSX.Formatting 3.0.0
Loading...
Searching...
No Matches
NanoXLSX.WorksheetExtensions Class Reference

Writer extension methods for the Worksheet class. More...

Static Public Member Functions

static void AddFormattedTextCell (this Worksheet worksheet, FormattedText formattedText, int columnNumber, int rowNumber)
 Adds a formatted text to the specified cell. If the WrapText property of the formatted text is set to true, the LineBreakStyle will be applied automatically.
static void AddFormattedTextCell (this Worksheet worksheet, FormattedText formattedText, int columnNumber, int rowNumber, Style style)
 Adds a formatted text to the specified cell with a style. If the WrapText property of the formatted text is set to true, the LineBreakStyle will be merged with the provided style automatically.
static void AddFormattedTextCell (this Worksheet worksheet, FormattedText formattedText, string address)
 Adds a formatted text to the specified cell address. If the WrapText property of the formatted text is set to true, the LineBreakStyle will be applied automatically.
static void AddFormattedTextCell (this Worksheet worksheet, FormattedText formattedText, string address, Style style)
 Adds a formatted text to the specified cell address with a style. If the WrapText property of the formatted text is set to true, the LineBreakStyle will be merged with the provided style automatically.
static void AddNextFormattedTextCell (this Worksheet worksheet, FormattedText formattedText)
 Adds a formatted text to the next cell position. The direction of the next cell depends on the current cell direction (default is Worksheet.CellDirection.ColumnToColumn). If the WrapText property of the formatted text is set to true, the LineBreakStyle will be applied automatically.
static void AddNextFormattedTextCell (this Worksheet worksheet, FormattedText formattedText, Style style)
 Adds a formatted text to the next cell position with a style. The direction of the next cell depends on the current cell direction (default is Worksheet.CellDirection.ColumnToColumn). If the WrapText property of the formatted text is set to true, the LineBreakStyle will be merged with the provided style automatically.
static void AddFormattedTextCellRange (this Worksheet worksheet, IReadOnlyList< FormattedText > values, string startAddress, string endAddress, Style style=null)
 Adds a list of formatted texts to a defined cell range. Values are distributed column-by-column from the start address. Null values will be inserted as empty cells. If the WrapText property of a formatted text is set to true, the LineBreakStyle will be applied automatically to that cell.
static void AddFormattedTextCellRange (this Worksheet worksheet, IReadOnlyList< FormattedText > values, Address startAddress, Address endAddress, Style style=null)
 Adds a list of formatted texts to a defined cell range with a style applied to all cells. Values are distributed column-by-column from the start address. Null values will be inserted as empty cells with the specified style. If the WrapText property of a formatted text is set to true, the LineBreakStyle will be merged with the provided style for that cell.
static void AddFormattedTextCellRange (this Worksheet worksheet, IReadOnlyList< FormattedText > values, string cellRange, Style style=null)
 Adds a list of formatted texts to a defined cell range with a style applied to all cells. Values are distributed column-by-column from the start of the range. Null values will be inserted as empty cells with the specified style. If the WrapText property of a formatted text is set to true, the LineBreakStyle will be merged with the provided style for that cell.

Detailed Description

Writer extension methods for the Worksheet class.

Definition at line 19 of file WorksheetExtensions.cs.

Member Function Documentation

◆ AddFormattedTextCell() [1/4]

void NanoXLSX.WorksheetExtensions.AddFormattedTextCell ( this Worksheet worksheet,
FormattedText formattedText,
int columnNumber,
int rowNumber )
static

Adds a formatted text to the specified cell. If the WrapText property of the formatted text is set to true, the LineBreakStyle will be applied automatically.

Parameters
worksheetWorksheet reference
formattedTextFormatted text object
columnNumberColumn number (zero based)
rowNumberRow number (zero based)
Exceptions
WorksheetExceptionThrows a WorksheetException if the passed text object is null
RangeExceptionThrows a RangeException if the passed cell address is out of range

Definition at line 30 of file WorksheetExtensions.cs.

◆ AddFormattedTextCell() [2/4]

void NanoXLSX.WorksheetExtensions.AddFormattedTextCell ( this Worksheet worksheet,
FormattedText formattedText,
int columnNumber,
int rowNumber,
Style style )
static

Adds a formatted text to the specified cell with a style. If the WrapText property of the formatted text is set to true, the LineBreakStyle will be merged with the provided style automatically.

Parameters
worksheetWorksheet reference
formattedTextFormatted text object
columnNumberColumn number (zero based)
rowNumberRow number (zero based)
styleStyle to apply to the cell. Will be merged with FormattedText.LineBreakStyle if FormattedText.WrapText true
Exceptions
WorksheetExceptionThrows a WorksheetException if the passed text object is null
RangeExceptionThrows a RangeException if the passed cell address is out of range

Definition at line 46 of file WorksheetExtensions.cs.

◆ AddFormattedTextCell() [3/4]

void NanoXLSX.WorksheetExtensions.AddFormattedTextCell ( this Worksheet worksheet,
FormattedText formattedText,
string address )
static

Adds a formatted text to the specified cell address. If the WrapText property of the formatted text is set to true, the LineBreakStyle will be applied automatically.

Parameters
worksheetWorksheet reference
formattedTextFormatted text object
addressCell address in the format A1 - XFD1048576 (e.g., "A1", "$B$5", "c12"). Case-insensitive, dollar signs are ignored
Exceptions
WorksheetExceptionThrows a WorksheetException if the passed text object is null
FormatExceptionThrows a FormatException if the passed address is malformed
RangeExceptionThrows a RangeException if the passed cell address is out of range

Definition at line 60 of file WorksheetExtensions.cs.

◆ AddFormattedTextCell() [4/4]

void NanoXLSX.WorksheetExtensions.AddFormattedTextCell ( this Worksheet worksheet,
FormattedText formattedText,
string address,
Style style )
static

Adds a formatted text to the specified cell address with a style. If the WrapText property of the formatted text is set to true, the LineBreakStyle will be merged with the provided style automatically.

Parameters
worksheetWorksheet reference
formattedTextFormatted text object
addressCell address in the format A1 - XFD1048576 (e.g., "A1", "$B$5", "c12"). Case-insensitive, dollar signs are ignored
styleStyle to apply to the cell. Will be merged with FormattedText.LineBreakStyle if FormattedText.WrapText true
Exceptions
WorksheetExceptionThrows a WorksheetException if the passed text object is null
FormatExceptionThrows a FormatException if the passed address is malformed
RangeExceptionThrows a RangeException if the passed cell address is out of range

Definition at line 78 of file WorksheetExtensions.cs.

◆ AddFormattedTextCellRange() [1/3]

void NanoXLSX.WorksheetExtensions.AddFormattedTextCellRange ( this Worksheet worksheet,
IReadOnlyList< FormattedText > values,
Address startAddress,
Address endAddress,
Style style = null )
static

Adds a list of formatted texts to a defined cell range with a style applied to all cells. Values are distributed column-by-column from the start address. Null values will be inserted as empty cells with the specified style. If the WrapText property of a formatted text is set to true, the LineBreakStyle will be merged with the provided style for that cell.

Parameters
worksheetWorksheet reference
valuesList of formatted text objects to insert. Null values are treated as empty cells
startAddressStart address of the range
endAddressEnd address of the range
styleOptional style to apply to all cells in the range. Will be merged with FormattedText.LineBreakStyle for cells where FormattedText.WrapText is true
Exceptions
WorksheetExceptionThrows a WorksheetException if the list of formatted texts is null or empty
RangeExceptionThrows a RangeException if the number of values does not match the number of cells in the range, or if any address is out of range

Definition at line 140 of file WorksheetExtensions.cs.

◆ AddFormattedTextCellRange() [2/3]

void NanoXLSX.WorksheetExtensions.AddFormattedTextCellRange ( this Worksheet worksheet,
IReadOnlyList< FormattedText > values,
string cellRange,
Style style = null )
static

Adds a list of formatted texts to a defined cell range with a style applied to all cells. Values are distributed column-by-column from the start of the range. Null values will be inserted as empty cells with the specified style. If the WrapText property of a formatted text is set to true, the LineBreakStyle will be merged with the provided style for that cell.

Parameters
worksheetWorksheet reference
valuesList of formatted text objects to insert. Null values are treated as empty cells
cellRangeCell range in the format A1:B10 (e.g., "A1:C5", "$A$1:$C$5", "a1:c5"). Case-insensitive, dollar signs are ignored
styleOptional style to apply to all cells in the range. Will be merged with FormattedText.LineBreakStyle for cells where FormattedText.WrapText is true
Exceptions
WorksheetExceptionThrows a WorksheetException if the list of formatted texts is null or empty
FormatExceptionThrows a FormatException if the cell range format is malformed
RangeExceptionThrows a RangeException if the number of values does not match the number of cells in the range, or if any address is out of range

Definition at line 156 of file WorksheetExtensions.cs.

◆ AddFormattedTextCellRange() [3/3]

void NanoXLSX.WorksheetExtensions.AddFormattedTextCellRange ( this Worksheet worksheet,
IReadOnlyList< FormattedText > values,
string startAddress,
string endAddress,
Style style = null )
static

Adds a list of formatted texts to a defined cell range. Values are distributed column-by-column from the start address. Null values will be inserted as empty cells. If the WrapText property of a formatted text is set to true, the LineBreakStyle will be applied automatically to that cell.

Parameters
worksheetWorksheet reference
valuesList of formatted text objects to insert. Null values are treated as empty cells
startAddressStart address of the range as string
endAddressEnd address of the range as string
styleOptional style to apply to all cells in the range. Will be merged with FormattedText.LineBreakStyle for cells where FormattedText.WrapText is true
Exceptions
WorksheetExceptionThrows a WorksheetException if the list of formatted texts is null or empty
RangeExceptionThrows a RangeException if the number of values does not match the number of cells in the range, or if any address is out of range

Definition at line 124 of file WorksheetExtensions.cs.

◆ AddNextFormattedTextCell() [1/2]

void NanoXLSX.WorksheetExtensions.AddNextFormattedTextCell ( this Worksheet worksheet,
FormattedText formattedText )
static

Adds a formatted text to the next cell position. The direction of the next cell depends on the current cell direction (default is Worksheet.CellDirection.ColumnToColumn). If the WrapText property of the formatted text is set to true, the LineBreakStyle will be applied automatically.

Parameters
worksheetWorksheet reference
formattedTextFormatted text object
Exceptions
WorksheetExceptionThrows a WorksheetException if the passed text object is null
RangeExceptionThrows a RangeException if the next cell address is out of range

Definition at line 94 of file WorksheetExtensions.cs.

◆ AddNextFormattedTextCell() [2/2]

void NanoXLSX.WorksheetExtensions.AddNextFormattedTextCell ( this Worksheet worksheet,
FormattedText formattedText,
Style style )
static

Adds a formatted text to the next cell position with a style. The direction of the next cell depends on the current cell direction (default is Worksheet.CellDirection.ColumnToColumn). If the WrapText property of the formatted text is set to true, the LineBreakStyle will be merged with the provided style automatically.

Parameters
worksheetWorksheet reference
formattedTextFormatted text object
styleStyle to apply to the cell. Will be merged with FormattedText.LineBreakStyle if FormattedText.WrapText is true
Exceptions
WorksheetExceptionThrows a WorksheetException if the passed text object is null
RangeExceptionThrows a RangeException if the next cell address is out of range

Definition at line 108 of file WorksheetExtensions.cs.


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