Worksheet
classin packageklyn.io.xlsx
public class Worksheet extends Object:
└ Worksheet

Worksheet contained in an XLSX workbook.

Cells are addressed with Excel A1 references. The implementation stores only explicitly written cells, which keeps simple exports fast and predictable.

Example
import klyn.io.xlsx

workbook = Workbook("report.xlsx")
sheet = workbook.addWorksheet("Data")
sheet.write("A1", "Name")
workbook.close()
Properties
Modifier and Type Member Description
public readonly property maxColumn
maxColumn as Int:
Maximum one-based column index containing data.
public readonly property maxRow
maxRow as Int:
Maximum one-based row index containing data.
public readonly property name
name as String:
Worksheet name.
Properties inherited from Object: type
Constructors
Modifier and Type Member Description
public Worksheet
Worksheet(name as String):
Creates a worksheet.
Methods
Modifier and Type Member Description
public hasCell
hasCell(reference as String) as Boolean:
Returns true when a cell exists.
public insertChart
insertChart(reference as String, chart as Chart) as Void:
Inserts a chart anchored at a cell.
public read
read(reference as String) as Object:
Reads one cell value.
public readString
readString(reference as String) as String:
Reads one cell value as text.
public rows
rows() as ArrayList<ArrayList<Object> >:
Returns a dense row matrix up to the largest written cell.
public setColumn
setColumn(range as String, width as Double) as Void:
Sets the width of a column range.
public setColumn
setColumn(range as String, width as Int) as Void:
Sets the width of a column range.
public write
write(reference as String, value as Object, format as Format = null) as Void:
Writes one cell value.
public writeColumn
writeColumn(reference as String, values as IList<Double>, format as Format = null) as Void:
Writes floating-point values vertically from a starting cell.
public writeColumn
writeColumn(reference as String, values as IList<Int>, format as Format = null) as Void:
Writes values vertically from a starting cell.
public writeColumn
writeColumn(reference as String, values as IList<Object>, format as Format = null) as Void:
Writes object values vertically from a starting cell.
public writeColumn
writeColumn(reference as String, values as IList<String>, format as Format = null) as Void:
Writes text values vertically from a starting cell.
Methods inherited from Object: deepCopy, fromJson, toDict, toJson, toString, toXml