NanoXLSX.Core 3.0.0-rc.3
Loading...
Searching...
No Matches
NanoXLSX.Shortener Class Reference

Class to provide access to the current worksheet with a shortened syntax. More...

Public Member Functions

 Shortener (Workbook reference)
 Constructor with workbook reference.
void SetCurrentWorksheet (Worksheet worksheet)
 Sets the worksheet accessed by the shortener.
void Value (object cellValue)
 Sets a value into the current cell and moves the cursor to the next cell (column or row depending on the defined cell direction).
void Value (object cellValue, Style style)
 Sets a value with style into the current cell and moves the cursor to the next cell (column or row depending on the defined cell direction).
void Formula (string cellFormula)
 Sets a formula into the current cell and moves the cursor to the next cell (column or row depending on the defined cell direction).
void Formula (string cellFormula, Style style)
 Sets a formula with style into the current cell and moves the cursor to the next cell (column or row depending on the defined cell direction).
void Down ()
 Moves the cursor one row down.
void Down (int numberOfRows, bool keepColumnPosition=false)
 Moves the cursor the number of defined rows down.
void Up ()
 Moves the cursor one row up.
void Up (int numberOfRows, bool keepColumnPosition=false)
 Moves the cursor the number of defined rows up.
void Right ()
 Moves the cursor one column to the right.
void Right (int numberOfColumns, bool keepRowPosition=false)
 Moves the cursor the number of defined columns to the right.
void Left ()
 Moves the cursor one column to the left.
void Left (int numberOfColumns, bool keepRowRowPosition=false)
 Moves the cursor the number of defined columns to the left.

Detailed Description

Class to provide access to the current worksheet with a shortened syntax.

Remarks
Note: The WS object can be null if the workbook was created without a worksheet. The object will be available as soon as the current worksheet is defined.

Definition at line 18 of file Shortener.cs.

Constructor & Destructor Documentation

◆ Shortener()

NanoXLSX.Shortener.Shortener ( Workbook reference)

Constructor with workbook reference.

Parameters
referenceWorkbook reference

Definition at line 27 of file Shortener.cs.

Member Function Documentation

◆ Down() [1/2]

void NanoXLSX.Shortener.Down ( )

Moves the cursor one row down.

Definition at line 101 of file Shortener.cs.

◆ Down() [2/2]

void NanoXLSX.Shortener.Down ( int numberOfRows,
bool keepColumnPosition = false )

Moves the cursor the number of defined rows down.

Parameters
numberOfRowsNumber of rows to move
keepColumnPositionIf true, the column position is preserved, otherwise set to 0
Remarks
An exception will be thrown if the row number is below 0. Values (number of rows) can be also negative. However, this is the equivalent of the function Down(int, bool)

Definition at line 113 of file Shortener.cs.

◆ Formula() [1/2]

void NanoXLSX.Shortener.Formula ( string cellFormula)

Sets a formula into the current cell and moves the cursor to the next cell (column or row depending on the defined cell direction).

Exceptions
WorksheetExceptionThrows a WorksheetException if no worksheet was defined
Parameters
cellFormulaFormula to set

Definition at line 80 of file Shortener.cs.

◆ Formula() [2/2]

void NanoXLSX.Shortener.Formula ( string cellFormula,
Style style )

Sets a formula with style into the current cell and moves the cursor to the next cell (column or row depending on the defined cell direction).

Exceptions
WorksheetExceptionThrows a WorksheetException if no worksheet was defined
Parameters
cellFormulaFormula to set
styleStyle to apply

Definition at line 92 of file Shortener.cs.

◆ Left() [1/2]

void NanoXLSX.Shortener.Left ( )

Moves the cursor one column to the left.

Remarks
An exception will be thrown if the column number is below 0

Definition at line 165 of file Shortener.cs.

◆ Left() [2/2]

void NanoXLSX.Shortener.Left ( int numberOfColumns,
bool keepRowRowPosition = false )

Moves the cursor the number of defined columns to the left.

Parameters
numberOfColumnsNumber of columns to move
keepRowRowPositionIf true, the row position is preserved, otherwise set to 0
Remarks
An exception will be thrown if the column number is below 0. Values can be also negative. However, this is the equivalent of the function Right(int, bool)

Definition at line 177 of file Shortener.cs.

◆ Right() [1/2]

void NanoXLSX.Shortener.Right ( )

Moves the cursor one column to the right.

Definition at line 144 of file Shortener.cs.

◆ Right() [2/2]

void NanoXLSX.Shortener.Right ( int numberOfColumns,
bool keepRowPosition = false )

Moves the cursor the number of defined columns to the right.

Parameters
numberOfColumnsNumber of columns to move
keepRowPositionIf true, the row position is preserved, otherwise set to 0

Definition at line 155 of file Shortener.cs.

◆ SetCurrentWorksheet()

void NanoXLSX.Shortener.SetCurrentWorksheet ( Worksheet worksheet)

Sets the worksheet accessed by the shortener.

Parameters
worksheetCurrent worksheet

Definition at line 37 of file Shortener.cs.

◆ Up() [1/2]

void NanoXLSX.Shortener.Up ( )

Moves the cursor one row up.

Remarks
An exception will be thrown if the row number is below 0/>

Definition at line 123 of file Shortener.cs.

◆ Up() [2/2]

void NanoXLSX.Shortener.Up ( int numberOfRows,
bool keepColumnPosition = false )

Moves the cursor the number of defined rows up.

Parameters
numberOfRowsNumber of rows to move
keepColumnPositionIf true, the column position is preserved, otherwise set to 0
Remarks
An exception will be thrown if the row number is below 0. Values can be also negative. However, this is the equivalent of the function Down(int, bool)

Definition at line 135 of file Shortener.cs.

◆ Value() [1/2]

void NanoXLSX.Shortener.Value ( object cellValue)

Sets a value into the current cell and moves the cursor to the next cell (column or row depending on the defined cell direction).

Exceptions
WorksheetExceptionThrows a WorksheetException if no worksheet was defined
Parameters
cellValueValue to set

Definition at line 57 of file Shortener.cs.

◆ Value() [2/2]

void NanoXLSX.Shortener.Value ( object cellValue,
Style style )

Sets a value with style into the current cell and moves the cursor to the next cell (column or row depending on the defined cell direction).

Exceptions
WorksheetExceptionThrows a WorksheetException if no worksheet was defined
Parameters
cellValueValue to set
styleStyle to apply

Definition at line 69 of file Shortener.cs.


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