Files
playbook/docs/tsl/codegen/dotnet/document/excel_class.md
T

1535 lines
41 KiB
Markdown

# 文档处理 / Excel操作相关的类
## `activeIndex()`
对象当前的sheet索引号,从0开始。 类型:读写
返回:any
## `add()`
在末尾新增一个sheet
返回:txlssheet
## `asBlank(col, row)`
是否为空白单元格
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:bool
## `asBoolean(col, row)`
将指定布尔类型的单元格的值转为天软的布尔类型返回。其它类型转换会报错。
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:bool
## `asBoolFormulaValue(col, row)`
返回指定布尔类型的单元格的结果。其它类型转换会报错。
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:bool
## `asDateTime(col, row)`
将指定日期时间单元格值转为天软时间类型输出
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:float|datetime
## `asEmpty(col, row)`
指定单元格是否为空
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:bool
## `asError(col, row)`
指定错误值单元格的错误类型
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `asFloat(col, row)`
将指定数字单元格值转为实数输出
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:float
## `asFmtString(col, row)`
将指定的格式化的单元格保留原格式输出
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asFmtStringW(col, row)`
将指定的格式化的单元格保留原格式输出
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asFormula(col, row)`
返回指定带计算的单元格的公式
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asFormulaW(col, row)`
返回指定带计算的单元格的公式,结果是一个宽字节字符串
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asHtml(col, row)`
将指定单元格的内容转成HTML格式
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asHtmlw(col, row)`
将指定单元格的内容转成HTML格式
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asHyperlink(col, row)`
返回指定的超链接的单元格的超链接内容
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asHyperlinkW(col, row)`
返回指定的超链接的单元格的超链接内容
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asInteger(col, row)`
将指定数字单元格值转为整数输出
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `asNumFormulaValue(col, row)`
将指定单元格的结果转为实数输出,若是非数字类型,则返回0。
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:float
## `asRichText(col, row)`
将指定单元格的值转为富文本输出
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asRichTextW(col, row)`
将指定单元格的值转为富文本输出
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asStrFormulaValue(col, row)`
将指定单元格的结果转为字符串输出,若是布尔值,则返回” TRUE”与“FALSE”,若是错误值,则返回“#VALUE!”等等。
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asStrFormulaValueW(col, row)`
将指定单元格的结果转为宽字节字符串输出,若是布尔值,则返回” TRUE”与“FALSE”,若是错误值,则返回“#VALUE!”等等。
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asString(col, row)`
将指定单元格的值强制转换成字符串。 类型:读写
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `asStringW(col, row)`
将指定单元格值转为宽字节字符串输出
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `autoHeightRow(v)`
自动调整指定行的行高
| 参数 | 类型 | 说明 |
| ---- | ---- | ----------------------- |
| `v` | any | 整数,指数行,从0开始。 |
返回:void
## `autoWidthCol(v)`
自动调整指定列的列宽
| 参数 | 类型 | 说明 |
| ---- | ---- | ----------------------- |
| `v` | any | 整数,指定列,从0开始。 |
返回:void
## `borderBottomColor(col, row)`
单元格的下边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderBottomColorRgb(col, row)`
单元格下边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderBottomStyle(col, row)`
单元格的下边框样式
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderDiagColor(col, row)`
单元格的对角线边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderDiagColorRgb(col, row)`
单元格对角线边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderDiagStyle(col, row)`
单元格的对角线边框样式
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderLeftColor(col, row)`
单元格的左边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderLeftColorRgb(col, row)`
单元格左边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderLeftStyle(col, row)`
单元格的左边框样式
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:TCellBorderStyle
## `borderRightColor(col, row)`
单元格的右边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderRightColorRgb(col, row)`
单元格右边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderRightStyle(col, row)`
单元格的右边框样式
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:TCellBorderStyle
## `borderTopColor(col, row)`
单元格的上边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderTopColorRgb(col, row)`
单元格上边框颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `borderTopStyle(col, row)`
单元格的上边框样式
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `calcCompleted()`
计算已完成 类型:读写
返回:any
## `calcMode()`
计算模式,0:Manual,1:Automatic,2:AutoExTables 类型:读写
返回:any
## `calcOnSave()`
保存时计算 类型:读写
返回:any
## `calculate(col, row)`
计算指定单元格的公式并返回结果
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | any | 整数,列的位置,从0开始。 |
| `row` | any | 整数,行的位置,从0开始。 |
返回:string
## `calculateW(col, row)`
计算指定单元格的公式并返回结果
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `cellColorRgb(col, row)`
单元格背景填充色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `cellType(col, row)`
单元格数据类型
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `clear()`
清空当前sheet中的内容。
返回:any
## `clearColumns(col1, col2)`
清空从Col1到Col2范围的列的值
| 参数 | 类型 | 说明 |
| ------ | ---- | --------------------- |
| `col1` | any | 整数,起始列,从0开始 |
| `col2` | any | 整数,终止列 |
返回:void
## `clearRows(row1, row2)`
清空从Row1到Row2范围的行的值
| 参数 | 类型 | 说明 |
| ------ | ---- | --------------------- |
| `row1` | any | 整数,起始行,从0开始 |
| `row2` | any | 整数,终止行 |
返回:void
## `colHide(col)`
指定列是否隐藏
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
返回:bool
## `colWidth(col)`
指定列的列宽
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
返回:int
## `comment(col, row)`
获取指定单元格的注释相关内容
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:array
## `commentW(col, row)`
指定单元格的注释相关内容
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:array
## `concurrentCalc()`
并发计算 类型:读写
返回:any
## `concurrentManualCount()`
并发线程手动计数 类型:读写
返回:any
## `copyCell(src_col, src_row, dest_col, dest_row, lock_start_row, clear_fmla)`
复制单元格。将指定单元格的内容复制到指定的新的单元格内。
| 参数 | 类型 | 说明 |
| ---------------- | ---- | --------------------------------------- |
| `src_col` | any | 整数,被复制的单元格的列标,从0开始。 |
| `src_row` | any | 整数,被复制的单元格的行标,从0开始。 |
| `dest_col` | any | 整数,存放位置的单元格的列标,从0开始。 |
| `dest_row` | any | 整数,存放位置的单元格的行标,从0开始。 |
| `lock_start_row` | bool | object |
| `clear_fmla` | bool | object |
返回:void
## `copyCells(col1, row1, col2, row2, dest_col, dest_row, copy_opt)`
复制单元格区间。
| 参数 | 类型 | 说明 |
| ---------- | ---- | -------------------------------------------------------- |
| `col1` | any | 整数,范围列的起始位置,从0开始。 |
| `row1` | any | 整数,范围行的起始位置,从0开始。 |
| `col2` | any | 整数,范围列的止点位置,从0开始。 |
| `row2` | any | 整数,范围行的止点位置,从0开始。 |
| `dest_col` | any | 整数,存放位置的起点的列标,从0开始。 |
| `dest_row` | any | 整数,存放位置的起点的行标,从0开始。 |
| `copy_opt` | any | 整数,复制单元格的选项,取值如下,多项并选则选项值相加。 |
返回:void
## `copyColumns(col1, col2, dest_col)`
复制列内容。将指定位置的列内容复制到新的指定列。
| 参数 | 类型 | 说明 |
| ---------- | ---- | ---------------------- |
| `col1` | any | 整数,起始列,从0开始 |
| `col2` | any | 整数,终止列 |
| `dest_col` | any | 整数,复制的开始列位置 |
返回:void
## `copyRows(row1, row2, dest_row)`
复制行内容。将指定位置的行内容复制到新的指定行。
| 参数 | 类型 | 说明 |
| ---------- | ---- | ---------------------- |
| `row1` | any | 整数,起始行,从0开始 |
| `row2` | any | 整数,终止行 |
| `dest_row` | any | 整数,复制的开始行位置 |
返回:void
## `count()`
当前Excel文件的Sheet数量 类型:读写
返回:int
### 示例
```tsl
setsysparam(pn_stock(),'SH000001');
setsysparam(pn_date(),inttodate(20140122));
return count(isup(),100);
```
## `defaultColWidth()`
默认列宽 类型:读写
返回:any
## `defaultRowHeight()`
默认行高 类型:读写
返回:any
## `delete(name_or_index, delete_count)`
删除从指定sheet开始的连续DeleteCount个sheet表
| 参数 | 类型 | 说明 |
| --------------- | ------ | ----------------------- |
| `name_or_index` | string | Integer |
| `delete_count` | any | 整数,要删除的sheet个数 |
返回:void
## `deleteCell(col, row, del_opt)`
删除指定单元格。
| 参数 | 类型 | 说明 |
| --------- | ---- | ------------------------------------------------------------ |
| `col` | any | 整数,列的位置,从0开始。 |
| `row` | any | 整数,行的位置,从0开始。 |
| `del_opt` | any | 整数,删除单元格时的选项,取值如下,多项并选则选项取值相加。 |
返回:void
## `deleteCells(col1, row1, col2, row2, del_opt)`
删除指定范围内的单元格。
| 参数 | 类型 | 说明 |
| --------- | ---- | ------------------------------------------------------------ |
| `col1` | any | 整数,范围列的起始位置,从0开始。 |
| `row1` | any | 整数,范围行的起始位置,从0开始。 |
| `col2` | any | 整数,范围列的止点位置,从0开始。 |
| `row2` | any | 整数,范围行的止点位置,从0开始。 |
| `del_opt` | any | 整数,删除单元格时的选项,取值如下,多项并选则选项取值相加。 |
返回:void
## `deleteColumns(col1, col2)`
删除从Col1到Col2范围的列
| 参数 | 类型 | 说明 |
| ------ | ---- | --------------------- |
| `col1` | any | 整数,起始列,从0开始 |
| `col2` | any | 整数,终止列 |
返回:void
## `deleteComment(col, row)`
删除批注
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------- |
| `col` | any | 列标,从0开始 |
| `row` | any | 行标,从0开始 |
返回:void
## `deleteRows(row1, row2)`
删除从Row1到Row2范围的行
| 参数 | 类型 | 说明 |
| ------ | ---- | --------------------- |
| `row1` | any | 整数,起始行,从0开始 |
| `row2` | any | 整数,终止行 |
返回:void
## `fillPatternBackColor(col, row)`
单元格的填充图案背景颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `fillPatternBackColorRgb(col, row)`
单元格填充背景色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `fillPatternForeColor(col, row)`
单元格的填充图案前景颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `fillPatternForeColorRgb(col, row)`
单元格填充图案颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `fillPatternPattern(col, row)`
单元格的填充图案类型
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `findCell(a_col, a_row)`
指定单元格是否存在
| 参数 | 类型 | 说明 |
| ------- | ---- | --------------------------------- |
| `a_col` | int | 整数,指定单元格所在列值,从0开始 |
| `a_row` | int | 整数,指定单元格所在行值,从0开始 |
返回:bool
## `firstCol()`
获取第一列非空值的列的序号
返回:int
## `firstRow()`
获取第一行非空值的行的序号
返回:int
## `fontColor(col, row)`
单元格的字体颜色
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `fontFamily(col, row)`
单元格的字体系列
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `fontName(col, row)`
单元格字体类型
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:string
## `fontNameW(col, row)`
指定单元格的字体名称,同FontName
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:string
## `fontSize(col, row)`
单元格的字体大小
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:float
## `fontStyle(col, row)`
单元格的字体样式
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `fontSubSuperScript(col, row)`
单元格中字体的上下标
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `fontUnderline(col, row)`
单元格中字体的下划线类型
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:int
## `forceFullCalc()`
强制完全计算。 类型:读写
返回:any
## `formulaType(col, row)`
单元格的公式类型
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `freezePanes(col, row)`
冻结指定窗格
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | any | 整数,列的位置,从0开始。 |
| `row` | any | 整数,行的位置,从0开始。 |
返回:void
## `fullCalcOnLoad()`
指示应用程序是否应因此工作表上的内容而对负载执行完全计算。 类型:读写
返回:any
## `fullPrecision()`
全精度计算 类型:读写
返回:any
## `groupColumns(a_col1, a_col2, acollapsed)`
对指定范围的列进行组合操作
| 参数 | 类型 | 说明 |
| ------------ | ---- | ----------------------- |
| `a_col1` | any | 整数,起始列值,从0开始 |
| `a_col2` | any | 整数,终止列值,从0开始 |
| `acollapsed` | bool | object |
返回:void
## `groupRows(a_row1, a_row2, acollapsed)`
对指定范围的行进行组合操作
| 参数 | 类型 | 说明 |
| ------------ | ---- | ----------------------- |
| `a_row1` | any | 整数,起始行值,从0开始 |
| `a_row2` | any | 整数,终止行值,从0开始 |
| `acollapsed` | bool | object |
返回:void
## `hasComment(col, row)`
指定单元格是否带批注
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------- |
| `col` | int | 列标,从0开始 |
| `row` | int | 行标,从0开始 |
返回:bool
## `horizAlignment(col, row)`
单元格的水平对齐方式
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `indent(col, row)`
单元格的缩进量
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `index()`
当前Sheet的序列号,从0开始 类型:读写
返回:any
## `insert(name_or_index, insert_count)`
在指定sheet的前面插入InsertCount个sheet
| 参数 | 类型 | 说明 |
| --------------- | ------ | --------------------- |
| `name_or_index` | string | Integer |
| `insert_count` | int | 整数,插入的sheet个数 |
返回:txlssheet
## `insertColumns(col1, col_count)`
插入空列。从第Col1行开始,插入ColCount个空列
| 参数 | 类型 | 说明 |
| ----------- | ---- | --------------------- |
| `col1` | any | 整数,起始列,从0开始 |
| `col_count` | any | 整数,列数 |
返回:void
## `insertRows(row1, row_count)`
从第Row1行开始,插入RowCount个空行
| 参数 | 类型 | 说明 |
| ----------- | ---- | --------------------- |
| `row1` | any | 整数,起始行,从0开始 |
| `row_count` | any | 整数,行数 |
返回:void
## `isChartSheet()`
是否为ChartSheet 类型:读写
返回:bool
## `isDateTime(col, row)`
指定单元格是否为时间日期格式。
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:bool
## `isError(col, row)`
指定单元格值是否为错误值。
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:bool
## `isFormatted(col, row)`
指定单元格的值是否格式化
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | int | 整数,列的位置,从0开始 |
| `row` | int | 整数,行的位置,从0开始 |
返回:bool
## `iterate()`
启用迭代计算 类型:读写
返回:any
## `iterateCount()`
最多迭代次数 类型:读写
返回:any
## `iterateDelta()`
迭代计算误差 类型:读写
返回:any
## `lastCol()`
获取最后一列非空值的列的序号
返回:int
## `lastRow()`
获取最后一行非空值的行的序号
返回:int
## `leftCol()`
左侧被隐藏的列数,不存在返回-1 类型:读写
返回:any
## `loadFromFile(alias, file_name)`
从指定路径中加载文件
| 参数 | 类型 | 说明 |
| ----------- | ------ | ---------------- |
| `alias` | string | 字符串,目录别名 |
| `file_name` | string | 字符串,文件名 |
返回:int
## `loadFromStream(stream)`
加载TStream类型数据
| 参数 | 类型 | 说明 |
| -------- | ---- | ---- |
| `stream` | any | |
返回:any
## `makeHyperlink(a_col, a_row, aaddress, atext, atooltip)`
为指定单元格创建超链接
| 参数 | 类型 | 说明 |
| ---------- | ------ | --------------------------------- |
| `a_col` | any | 整数,指定单元格所在列值,从0开始 |
| `a_row` | any | 整数,指定单元格所在行值,从0开始 |
| `aaddress` | string | 字符串,点击超链接导向的地址 |
| `atext` | string | 字符串,单元格文本值 |
| `atooltip` | string | 字符串,鼠标悬浮时提示文本 |
返回:void
## `mergeCells(col1, row1, col2, row2)`
合并单元格
| 参数 | 类型 | 说明 |
| ------ | ---- | --------------------------------- |
| `col1` | any | 整数,范围列的起始位置,从0开始。 |
| `row1` | any | 整数,范围行的起始位置,从0开始。 |
| `col2` | any | 整数,范围列的止点位置,从0开始。 |
| `row2` | any | 整数,范围行的止点位置,从0开始。 |
返回:void
## `mergedCells()`
返回Sheet中合并单元格的区间位置
返回:array
## `moveCell(src_col, src_row, dest_col, dest_row, adjust_cell, lock_start)`
移动单元格。
| 参数 | 类型 | 说明 |
| ------------- | ---- | --------------------------------------- |
| `src_col` | any | 整数,被复制的单元格的列标,从0开始。 |
| `src_row` | any | 整数,被复制的单元格的行标,从0开始。 |
| `dest_col` | any | 整数,存放位置的单元格的列标,从0开始。 |
| `dest_row` | any | 整数,存放位置的单元格的行标,从0开始。 |
| `adjust_cell` | bool | object |
| `lock_start` | bool | object |
返回:void
## `moveCells(col1, row1, col2, row2, dest_col, dest_row, copy_opt)`
移动指定范围内的单元格。
| 参数 | 类型 | 说明 |
| ---------- | ---- | -------------------------------------------------------- |
| `col1` | any | 整数,范围列的起始位置,从0开始。 |
| `row1` | any | 整数,范围行的起始位置,从0开始。 |
| `col2` | any | 整数,范围列的止点位置,从0开始。 |
| `row2` | any | 整数,范围行的止点位置,从0开始。 |
| `dest_col` | any | 整数,存放位置的起点的列标,从0开始。 |
| `dest_row` | any | 整数,存放位置的起点的行标,从0开始。 |
| `copy_opt` | any | 整数,移动单元格的选项,取值如下,多项并选则选项值相加。 |
返回:void
## `moveColumns(col1, col2, dest_col)`
移动列内容。将指定位置的列内容移动到新的指定列。
| 参数 | 类型 | 说明 |
| ---------- | ---- | ---------------------------- |
| `col1` | any | 整数,起始列,从0开始 |
| `col2` | any | 整数,终止列 |
| `dest_col` | any | 整数,移动到的新的列开始位置 |
返回:void
## `moveRows(row1, row2, dest_row)`
移动行内容。将指定位置的行内容移动到新的指定行。
| 参数 | 类型 | 说明 |
| ---------- | ---- | ---------------------------- |
| `row1` | any | 整数,起始行,从0开始 |
| `row2` | any | 整数,终止行 |
| `dest_row` | any | 整数,移动到的新的行开始位置 |
返回:void
## `name()`
当前Sheet的名称 类型:读写
返回:string
## `nameW()`
当前Sheet的名称,宽字节字符串 类型:读写
返回:string
## `numberFormat(col, row)`
单元格的数字格式
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | any | 整数,列的位置,从0开始。 |
| `row` | any | 整数,行的位置,从0开始。 |
返回:string
## `numberFormatW(col, row)`
单元格的数字格式
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string
## `options()`
选项 类型:读写
返回:any
## `password()`
密码 类型:读写
返回:any
## `protection(col, row)`
单元格的保护选项类型
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | any | 整数,列的位置,从0开始。 |
| `row` | any | 整数,行的位置,从0开始。 |
返回:any
## `refMode()`
引用模式。0即 A1 模式,当项序列化为 xml 时,其值为“A1”。1即R1C1 引用模式, 将项序列化为 xml 时,其值为“R1C1”。 类型:读写
返回:any
## `rotation(col, row)`
单元格的方向旋转度数
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `rowHeight(row)`
指定行的行高
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `row` | int | 整数,行的位置,从0开始。 |
返回:int
## `rowHide(row)`
指定行是否隐藏
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `row` | int | 整数,行的位置,从0开始。 |
返回:bool
## `saveToFile(alias, file_name)`
将当前的对象另存为新文件。
| 参数 | 类型 | 说明 |
| ----------- | ------ | ---------------- |
| `alias` | string | 字符串,目录别名 |
| `file_name` | string | 字符串,文件名 |
返回:int
## `saveToStream(stream)`
保存为TStream类型
| 参数 | 类型 | 说明 |
| -------- | ---- | ----------- |
| `stream` | any | TStream类型 |
返回:any
## `setDefaultFormat(col, row)`
将指定单元格设置为默认格式
| 参数 | 类型 | 说明 |
| ----- | ---- | ----------------------- |
| `col` | any | 整数,列的位置,从0开始 |
| `row` | any | 整数,行的位置,从0开始 |
返回:void
## `sheets(name_or_index)`
获取指定sheet对象,当指定的sheet不存在时,会报错。
| 参数 | 类型 | 说明 |
| --------------- | ------ | ------- |
| `name_or_index` | string | Integer |
返回:txlssheet
## `shrinkToFit(col, row)`
单元格的是否自动收缩
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:bool
## `sort(col1, row1, col2, row2, is_asc, case_sense)`
对指定范围内的单元格值进行排序。
| 参数 | 类型 | 说明 |
| ------------ | ---- | ------------------------------- |
| `col1` | any | 整数,起始单元格的列值,从0开始 |
| `row1` | any | 整数,起始单元格的行值,从0开始 |
| `col2` | any | 整数,终止单元格的列值 |
| `row2` | any | 整数,终止单元格的行值 |
| `is_asc` | bool | object |
| `case_sense` | bool | object |
返回:void
## `splitPanes(points_width, points_height)`
拆分窗格
| 参数 | 类型 | 说明 |
| --------------- | ---- | ---------------------- |
| `points_width` | any | 整数,拆分中心点的宽度 |
| `points_height` | any | 整数,拆分中心点的高度 |
返回:void
## `topRow()`
最上方被隐藏的行数,不存在返回-1 类型:读写
返回:any
## `unfreezePanes()`
解除冻结窗格
返回:any
## `ungroupColumns(a_col1, a_col2)`
对指定范围的已组合的列进行取消组合操作
| 参数 | 类型 | 说明 |
| -------- | ---- | ----------------------- |
| `a_col1` | int | 整数,起始行值,从0开始 |
| `a_col2` | int | 整数,终止行值,从0开始 |
返回:bool
## `ungroupRows(a_row1, a_row2)`
对指定范围的已组合的行进行取消组合操作
| 参数 | 类型 | 说明 |
| -------- | ---- | ----------------------- |
| `a_row1` | int | 整数,起始行值,从0开始 |
| `a_row2` | int | 整数,终止行值,从0开始 |
返回:bool
## `unMergeCells(col1, row1, col2, row2)`
取消合并的单元格
| 参数 | 类型 | 说明 |
| ------ | ---- | --------------------------------- |
| `col1` | any | 整数,范围列的起始位置,从0开始。 |
| `row1` | any | 整数,范围行的起始位置,从0开始。 |
| `col2` | any | 整数,范围列的止点位置,从0开始。 |
| `row2` | any | 整数,范围行的止点位置,从0开始。 |
返回:void
## `unsplitPanes()`
取消拆分窗格
返回:any
## `value(col, row)`
获取指定单元格的值
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:any
## `values(col1, row1, col2, row2)`
获取当前sheet中列Col1到Col2,行Row1到Row2范围内的内容
| 参数 | 类型 | 说明 |
| ------ | ---- | --------------------------------- |
| `col1` | int | 整数,范围列的起始位置,从0开始。 |
| `row1` | int | 整数,范围行的起始位置,从0开始。 |
| `col2` | int | 整数,范围列的止点位置,从0开始。 |
| `row2` | int | 整数,范围行的止点位置,从0开始。 |
返回:array
## `valuesW(col1, row1, col2, row2)`
列Col1到Col2,行Row1到Row2范围内的内容
| 参数 | 类型 | 说明 |
| ------ | ---- | --------------------------------- |
| `col1` | int | 整数,范围列的起始位置,从0开始。 |
| `row1` | int | 整数,范围行的起始位置,从0开始。 |
| `col2` | int | 整数,范围列的止点位置,从0开始。 |
| `row2` | int | 整数,范围行的止点位置,从0开始。 |
返回:array
## `valueW(col, row)`
获取指定单元格的值,若是字符串,则返回的是一个宽字节字符串。
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:any
## `version()`
当前excel版本号,其中,值对应如下 : 值 版本 0 None 1 ExcelUnknown 2 Excel21 3 Excel30 4 Excel40 5 Excel50 6 Excel97 7 Excel2007 8 Office2007Encrypted 类型:读写
返回:any
## `vertAlignment(col, row)`
单元格的垂直对齐方式
| 参数 | 类型 | 说明 |
| ----- | ---- | ------------------------- |
| `col` | int | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:TVertAlignment
## `wrapText(col, row)`
单元格的是否换行
| 参数 | 类型 | 说明 |
| ----- | ------ | ------------------------- |
| `col` | string | 整数,列的位置,从0开始。 |
| `row` | int | 整数,行的位置,从0开始。 |
返回:string