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 AddSheet 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.
Method DeleteSheet Deletes the specified sheet from the run-time data table.
Export Saves a copy of the run-time data table in the specified location.
ExportSheet Exports a specified sheet of the run-time data table to the specified sheet in the specified file.
GetCurrentRow Returns the current (active) row in the first sheet in the run-time data table (global sheet).
GetRowCount Returns the total number of rows in the longest column in the first sheet in the run-time data table (global sheet).
GetSheet Returns the specified sheet from the run-time data table.
GetSheetCount Returns the total number of sheets in the run-time data table.
GlobalSheet Returns the first sheet in the run-time data table (global sheet).
Import Imports the specified Microsoft Excel file to the run-time data table.
ImportSheet Imports a sheet of a specified file to a specified sheet in the run-time data table.
LocalSheet Returns the current (active) local sheet of the run-time data table.
RawValue Retrieves the raw value of the cell in the specified parameter and the current row of the run-time data table.
SetCurrentRow Sets the specified row as the current (active) row in the run-time data table.
SetNextRow Sets the row after the current (active) row as the new current row in the run-time data table.
SetPreviousRow Sets the row above the current (active) row as the new current (active) row in the run-time data table.
Value 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.

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.

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.

vtSrcSheet Variant

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 Data table by the index number of the sheet in the table 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:

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).

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:

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

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:

To set the value:

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: