DataTable Object

Description

The run-time data table.

Note: All methods performed on this object apply to the run-time data table object only. Changes to the run-time DataTable object are reflected in the run results, but the design-time data table is not affected.

Methods and Properties

Method AddSheetAdds the specified sheet to the run-time data table and returns the sheet so that you can directly set properties of the new sheet in the same statement.
Method DeleteSheetDeletes the specified sheet from the run-time data table.
ExportSaves a copy of the run-time data table in the specified location.
ExportSheetExports a specified sheet of the run-time data table to the specified sheet in the specified file.
GetCurrentRowReturns the current (active) row in the first sheet in the run-time data table (global sheet).
GetRowCountReturns the total number of rows in the longest column in the first sheet in the run-time data table (global sheet).
GetSheetReturns the specified sheet from the run-time data table.
GetSheetCountReturns the total number of sheets in the run-time data table.
GlobalSheetReturns the first sheet in the run-time data table (global sheet).
ImportImports the specified Microsoft Excel file to the run-time data table.
ImportSheetImports a sheet of a specified file to a specified sheet in the run-time data table.
LocalSheetReturns the current (active) local sheet of the run-time data table.
RawValueRetrieves the raw value of the cell in the specified parameter and the current row of the run-time data table.
SetCurrentRowSets the specified row as the current (active) row in the run-time data table.
SetNextRowSets the row after the current (active) row as the new current row in the run-time data table.
SetPreviousRowSets the row above the current (active) row as the new current (active) row in the run-time data table.
ValueDataTable default property. Retrieves or sets the value of the cell in the specified parameter and the current row of the run-time data table.

Back to top

AddSheet Method

Description

Adds the specified sheet to the run-time data table and returns the sheet so that you can directly set properties of the new sheet in the same statement.

Syntax

DataTable.AddSheet SheetName

Argument

Type

Description

SheetName

String

Assigns a name to the new sheet.

Return Value

DTSheet Object.

Back to top

DeleteSheet Method

Description

Deletes the specified sheet from the run-time data table.

Syntax

DataTable.DeleteSheet SheetID

Argument

Type

Description

SheetID

Variant

Identifies the sheet to be returned. The SheetID can be the sheet name or index. Index values begin with 1.

Back to top

Export Method

Description

Saves a copy of the run-time data table in the specified location.

Syntax

DataTable.Export FileName

Argument

Type

Description

FileName

String

The full file system path of the location to which the data table should be exported.

IMPORTANT

This method is not supported for business components or BPT tests.

Back to top

ExportSheet Method

Description

Exports a specified sheet of the run-time data table to the specified sheet in the specified file.

  • If you do not specify a destination sheet name, the source sheet name is used for the destination.

  • If the specified file does not exist, a new file is created and the specified sheet is saved.
  • If the current file exists, but the file does not contain a sheet with the specified sheet name, the sheet is inserted as the last sheet of the file.

  • If the current file exists and the file contains the specified sheet, the exported sheet overwrites the existing sheet.

Syntax

DataTable.ExportSheet FileName, vtSrcSheet, [DstSheetName]

Argument

Type

Description

FileName

String

The full file system path of the Excel table to which you want to export a sheet.

vtSrcSheetVariant

The name or index of the run-time Data pane sheet that you want to export. Index values begin with 1.

DstSheetName

Variant

Optional. The name of the sheet in the file that you want to create or replace with the data from vtSrcSheet.

IMPORTANT

When you export a single sheet from a component or a BPT test, you use the following format:

DataTable.ExportSheet FileName, vtSrcSheet, [DstSheetName]

For the vtSrcSheet parameter, you can specify the source sheet in the Datatable by the index number of the sheet in the table. However, when working with a component, the index of the exported sheet is different if you are running the component by itself or in a Business Process Testing test:

  • When running a component individually, the index 1 refers to the data sheet of the component.
  • When running a BPT test, the index 1 refers to the global sheet of the Business Process Testing test run.

Because of these differing indexes, if you assign the value 1 for the vtSrcSheet parameter, it is imported to different places depending on where you are running your component.

As a result, it is recommended not to use the index of the sheet for the vtSrcSheet parameter.

Back to top

GetCurrentRow Method

Description

Returns the current (active) row in the first sheet in the run-time data table (global sheet).

Syntax

DataTable.GetCurrentRow

Return Value

Number

Back to top

GetRowCount Method

Description

Returns the total number of rows in the longest column in the first sheet in the run-time data table (global sheet).

Syntax

DataTable.GetRowCount

Return Value

Number

Back to top

GetSheet Method

Description

Returns the specified sheet from the run-time data table.

Syntax

DataTable.GetSheet SheetID

Argument

Type

Description

SheetID

Variant

Identifies the sheet to be returned. The Sheet ID can be the sheet name or index. Index values begin with 1.

Return Value

DTSheet Object

Back to top

GetSheetCount Method

Description

Returns the total number of sheets in the run-time data table.

Syntax

DataTable.GetSheetCount

Return Value

Number

Back to top

GlobalSheet Property

Description

Returns the first sheet in the run-time data table (global sheet).

Syntax

DataTable.GlobalSheet

Back to top

Import Method

Description

Imports the specified Microsoft Excel file to the run-time data table.

Note: The imported table must match the test. The column names must match the parameters in the test, and the sheet names must match the action names.

If you import an Excel table containing combo box or list cells, conditional formatting, or other special cell formats, the formats are not imported and the cell is displayed in the data table with a fixed value.

Syntax

DataTable.Import FileName

Argument

Type

Description

FileName

String

The full or relative path of the Excel table to import. It can be a file system or ALM path.

IMPORTANT

This method is not supported for business components or BPT tests.

Back to top

ImportSheet Method

Description

Imports a sheet of a specified file to a specified sheet in the run-time data table. The data in the imported sheet replaces the data in the destination sheet (see vtDstSheetargument).

  • The column headings in the sheet you import must match the data table parameter names in the action for which the sheet is being imported. Otherwise, your test or component may fail.

  • The sheet you import automatically takes the name of the sheet it replaces.

  • If you import an excel sheet containing combo box or list cells, conditional formatting, or other special cell formats, the formats are not imported and the cell is displayed in the data table with a fixed value.

Syntax

DataTable.ImportSheet FileName, vtSrcSheet, vtDstSheet

Argument

Type

Description

FileName

String

The full or relative path of the Excel table from which you want to import a sheet. It can be a file system or ALM path.

vtSrcSheet

Variant

The name or index of the sheet in the file that you want to import. Index values begin with 1.

vtDstSheet

Variant

The name or index of the sheet in the data table that you want to replace with the vtSrcSheet. Index values begin with 1.

IMPORTANT

When you import a single sheet to a component or BPT test, you use the following format:

DataTable.ImportSheet FileName, vtSrcSheet, vtDstSheet

For the vtDstSheet parameter, you can specify the source sheet in the Data table by the index number of the sheet in the table. However, when working with a component, the index of the sheet is different if you are running the component by itself or in a Business Process Testing test:

  • When running a component individually, the index 1 refers to the data sheet of the component.
  • When running a BPT test, the index 1 refers to the global sheet of the Business Process Testing test run.

Because of these differing indexes, if you assign the value 1 for the vtDstSheet parameter, it is imported to different places depending on where you are running your component.

As a result, it is recommended not to use the index of the sheet for the vtDstSheet parameter.

Back to top

LocalSheet Property

Description

Returns the current (active) local sheet of the run-time data table.

Syntax

DataTable.LocalSheet

Back to top

RawValue Property

Description

Retrieves the raw value of the cell in the specified parameter and the current row of the run-time data table. The raw value is the actual string written in a cell before the cell has been computed, such as the actual text from a formula.

Syntax

DataTable.RawValueParameterID, [SheetID]

Argument

Type

Description

ParameterID

Variant

Identifies the parameter (column) of the value to be set/retrieved. Index values begin with 1.

Note: The specified value must be an actual column header name that has been defined as a data table parameter. Entering A (or another default column label) as the column name is not valid unless A has explicitly been set as the name of a data table parameter.

SheetID

Variant

Optional. Identifies the sheet to be returned. The SheetID can be the sheet name, index or dtLocalSheet, or dtGlobalSheet.

If no Sheet is specified, the first sheet in the run-time data table is used (global sheet). Index values begin with 1.

Back to top

SetCurrentRow Method

Description

Sets the specified row as the current (active) row in the run-time data table.

Syntax

DataTable.SetCurrentRow(RowNumber)

Argument

Type

Description

RowNumber

Number

Indicates the number of the row to set as the active row. The first row is numbered 1.

IMPORTANT

  • You can set a row only if it contains at least one value.

  • If you call another action (local or external) after performing this method, then when you return to the current action after the called action is complete, the current row in the action sheet is reset to the row corresponding to the current iteration (regardless of the value previously set in the DataTable.SetCurrentRow step.)

Back to top

SetNextRow Method

Description

Sets the row after the current (active) row as the new current row in the run-time data table.

Note: You can only set a row that contains at least one value. If the current row is the last row in the data table, applying this method sets the first row in the data table as the new current row.

Syntax

DataTable.SetNextRow

Back to top

SetPrevRow Method

Description

Sets the row above the current (active) row as the new current (active) row in the run-time data table.

Note: If the current row is the first row in the data table, applying this method sets the last row in the data table as the new current row.

Syntax

DataTable.SetPrevRow

Back to top

Value Property

Description

DataTable default property. Retrieves or sets the value of the cell in the specified parameter and the current row of the run-time data table.

Note: This property returns the computed value of the cell. For example, if the cell contains a formula, the method returns True or False.

Syntax

To find the value:

  • DataTable.Value ParameterID, [SheetID] or
  • DataTable ParameterID, [SheetID]

To set the value:

  • DataTable.Value(ParameterID, [SheetID])=NewValue
  • DataTable(ParameterID, [SheetID]) =NewValue

Argument

Type

Description

ParameterID

Variant

Identifies the parameter (column) of the value to be set/retrieved. Index values begin with 1.

SheetID

Variant

Optional. Identifies the sheet to be returned. The SheetID can be the sheet name, index or dtLocalSheet, or dtGlobalSheet.

If no Sheet is specified, the first sheet in the run-time data table is used (global sheet). Index values begin with 1.

NewValue

String

Sets the value for the specified table cell.

Back to top

See also: