Home Reference Source Test Repository
public class | source

XlsxUtil

Provides utility methods for XLSX.

Test:

Static Method Summary

Static Public Methods
public static

Create a empty cells.

public static

Get a cells from a rows.

public static

Get the coordinates of the cell.

public static

getSheetSize(sheet: Object, cells: Array<Array>): Object

Get the size of the sheet.

public static

Convert the column text to number.

public static

Parse the "r" element of XML.

public static

Parse the "t" element of XML.

public static

Parse the XML text.

public static

Extract a zip file.

public static

Get a value from the cell strings.

Static Public Methods

public static createEmptyCells(rows: Number, cols: Number): Array<Array<String>> source

Create a empty cells.

Params:

NameTypeAttributeDescription
rows Number

Rows count.

cols Number

Columns count.

Return:

Array<Array<String>>

Cells.

public static getCells(rows: Array<Object>): Array<Object> source

Get a cells from a rows.

Params:

NameTypeAttributeDescription
rows Array<Object>

Rows.

Return:

Array<Object>

Cells.

public static getPosition(text: String): Object source

Get the coordinates of the cell.

Params:

NameTypeAttributeDescription
text String

Position text. Such as "A1" and "U109".

Return:

Object

Position.

public static getSheetSize(sheet: Object, cells: Array<Array>): Object source

Get the size of the sheet.

Params:

NameTypeAttributeDescription
sheet Object

Sheet data.

cells Array<Array>

Cells.

Return:

Object

Size

public static numOfColumn(text: String): Number source

Convert the column text to number.

Params:

NameTypeAttributeDescription
text String

Column text, such as A" and "AA".

Return:

Number

Column number, otherwise -1.

public static parseR(r: Array<Object>): String source

Parse the "r" element of XML.

Params:

NameTypeAttributeDescription
r Array<Object>

"r" elements.

Return:

String

Parse result.

public static parseT(t: Array<Object>): String source

Parse the "t" element of XML.

Params:

NameTypeAttributeDescription
t Array<Object>

"t" elements.

Return:

String

Parse result.

public static parseXML(xml: String): Promise source

Parse the XML text.

Params:

NameTypeAttributeDescription
xml String

XML text.

Return:

Promise

XML parse task.

public static unzip(path: String): ZipObject source

Extract a zip file.

Params:

NameTypeAttributeDescription
path String

Zip file path.

Return:

ZipObject

If success zip object, otherwise null.

public static valueFromStrings(str: Object): String source

Get a value from the cell strings.

Params:

NameTypeAttributeDescription
str Object

Cell strings.

Return:

String

Value.