You are on page 1of 2

3/25/23, 4:36 PM Function: InsertRow

Function: InsertRow
Function Prototype

Note

Parameter Description

Return Value

Error Handling

Example

Result

This section describes the InsertRow function. This function enables you to insert a row in a
specified table according to the row number.

Function Prototype
InsertRow(sheetName, tableNo, rowNo, dataList)

Note
None

Parameter Description

Parameter Description

sheetName Name of a sheet. The value is a string.

tableNo Number of the table to which the data is inserted


on a specified sheet. The value is an integer starting
from 0.

rowNo Number of the row to which a row is inserted. The


value is an integer starting from 0. The value -1
indicates the last row.

dataList Data list to be inserted. The value is a string list.

Return Value

https://10.98.117.5:31943/hedex/hedex.do?lib=OMC&id=omc.Scriptapp.mainpage&topicid=p_insertrow_a&locale=en-us 1/2
3/25/23, 4:36 PM Function: InsertRow

The return value is an integer. If this function is successfully called, 1 is returned. Otherwise, 0 is
returned.

Error Handling
None

Example

sheetName = "sheet1"
tableNo = 0
rowNo = -1
datalist = ["data0", "data1", "data2", "data3"]

NewReport()
page1 = AddSheet("sheet1")
table1 = AddTable(page1, 6, 4, "table1")

#Insert a row to the specified row in the specified table.


InsertRow( sheetName, tableNo, rowNo, datalist )

SaveReportAs("result.xls")

Result
The following figure shows the contents of result.xls.

Examples of Report Operation Function

Copyright © Huawei Technologies Co., Ltd.

https://10.98.117.5:31943/hedex/hedex.do?lib=OMC&id=omc.Scriptapp.mainpage&topicid=p_insertrow_a&locale=en-us 2/2

You might also like