Version

WinPivotGrid Actions

Topic Overview

Purpose

This topic provides an overview of the recording and replaying actions available within the WinPivotGrid™ control proxy using the UltraPivotGridTestobject object to represent the corresponding sub items and behaviors.

Identifying Drop Items

Index mode

The following preview illustrates the Index mode as a single integer of a 0-based index making it easier to identify cells; however, the headers can only be identified by the primary header, for example, headers bordered with cells.

WinPivotGrid Actions 1.png

Coordinate Index mode

Coordinate based index mode consists of a 0-based two-dimensional array of integer.

The first index is the row of the header.

The second index is the column of the header.

Columns can span both rows and columns returning a single header by multiple different combinations of coordinates. Consider the following coordinates for the outlined color-coded elements in the screenshot illustrated below it:

  • The Reseller Freight Cost, outlined in pale blue, is represented by ARRAY(4,1)

  • The CY 2001 outlined in lime green may be represented by any of the following, ARRAY(3,1), ARRAY (3,2), or ARRAY(3,3)

WinPivotGrid Actions 2.png

String mode

The String based mode is an array of strings representing the path from the top row down in the case of columns or the left column right in the case of rows. In some scenarios, there may be repeat string values under the same parent. In those cases, the duplicates will add a zero based index identifier after the string during recording. In most cases, you will only see this on the summary row\columns.

For example, in the above illustration the “ Reseller Freight Cost ” lined in pale blue would be…

ARRAY(“All Products”, “Accessories”, “All Products”, “Reseller Freight Cost”)

Note
Note:

that even though “ All Products ” and “ Reseller Freight Cost ” repeat, they do not repeat under the same parent so they do not need identifiers.

The “ CY 2001 ” lined in lime green, will be identified as ARRAY(“All Periods”, “CY 2001#1”), as this “ CY 2001 ” is the second child with that text under the “ All Periods ” parent.

WinPivotGrid Actions

Overview

The WinPivotGrid elements are identified by Sub items triggered by user input to different actions. This section provides you with detail information about those actions and behaviors with examples of the recorded scripts.

Note
Note:

Throughout this topic the “ DropItem ” term is used as an item dropped from the data selector’s dimensions or measures list on to the pivot grid, or removed from it.

ActivateCell

Description

Activates the identified pivot cell.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oRowArg oColumnArg

Contains Integer index, string array of the text path, or two dimensional array of integer’s row, column position that represents the location of the appropriate header.

Example

The following 3 code examples will all activate the same cell:

SwfTable("Identifier").ActivateCell 0,0
SwfTable("Identifier").ActivateCell ARRAY(0, 3), ARRAY(3,0)
SwfTable("Identifier").ActivateCell ARRAY(“All Periods”, “CY 2001”, “H2 CY 2001”, “Q3 CY 2001”), ARRAY(“All Products”, “Accessories”, “All Products”, Reseller Sales Amount”)

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The specified {0} index [{1}] is out of range.

  • The following {0} [{1}] was not found.

SortColumn

Description

Sorts the identified column.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oColumnArg

Contains Integer index, string array of the text path, or two dimensional array of integer’s row, column position that represents the location of the appropriate header.

oeSortDirection

Contains enumerated value, string name, or integer value representing the Sort direction via the PvtGSortDirection enumeration.

[Optional] bExtend

Contains Boolean value if sorting should be extended.

Example

The following 3 code examples will all activate the same cell:

SwfTable("Identifier").SortColumn 0, pvtgAscending
SwfTable("Identifier").SortColumn ARRAY(0, 3), pvtgDescending
SwfTable("Identifier").SortColumn ARRAY(“All Products”, “Accessories”, “All Products”, Reseller Sales Amount”), pvtgAscending

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The specified {0} index [{1}] is out of range

  • The following {0} [{1}] was not found

  • Sorting is disabled

  • The point required to perform the operation is not visible

  • The specified value [oeSortDirection] is invalid

SelectHeader

Description

Selects the identified row or column header.

Parameters

The following table summarizes the method’s parameters followed by code examples where applicable.

Parameter Description

oeHeaderType

Contains enumerated value, string name, or integer value representing the header type via the PvtGHeaderType enumeration.

oHeaderArg

Contains Integer index, string array of the text path, or two dimensional array of integer’s row, column position that represents the location of the appropriate header.

[Optional] bShift

Contains Boolean value if the Shift key should be pressed.

[Optional] bCtrl

Contains Boolean value if the Ctrl key should be pressed.

Example

Selects the first row:

SwfTable("Identifier").SelectHeader pvtgHeaderRow, 0

Selects: All Periods, CY 2003, H2 CY 2003 to the row header:

SwfTable("Identifier"). SelectHeader pvtgHeaderRow, ARRAY(“All Periods”, “CY 2003”, “H2 CY 2003”), true

Adds the column header to the selection:

SwfTable("Identifier"). SelectHeader pvtgHeaderColumn, 2, false, true

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The option supplied is any invalid options, valid options are [pvtgHeaderRow, pvtgHeaderColumn]

  • The specified {0} index [{1}] is out-of-range The following {0} [{1}] was not found

  • Selection of item type [{0}] is disabled

  • Cannot perform a span selection across multiple types

SelectCell

Description

Selects the identified cell.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oRowArg, oColumnArg

Contains an integer index, string array of the text path, or a two-dimensional array of integer’s row, column position that represents the location of the appropriate header.

[Optional] bShift

Contains Boolean value if the Shift key should be pressed.

[Optional] bCtrl

Contains Boolean value if the Ctrl key should be pressed.

Example

Selects the first row:

SwfTable("Identifier").SelectHeader pvtgHeaderRow, 0

Selects: All Periods, CY 2003, H2 CY 2003 to the row header:

SwfTable("Identifier"). SelectHeader pvtgHeaderRow, ARRAY(“All Periods”, “CY 2003”, “H2 CY 2003”), true

Adds the column header to the selection:

SwfTable("Identifier"). SelectHeader pvtgHeaderColumn, 2, false, true

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The supplied option is an invalid options, where the only valid options are [pvtgHeaderRow, pvtgHeaderColumn]

  • The specified {0} index [{1}] is out-of-range.

  • The following {0} [{1}] was not found

  • Selection of item type [{0}] disabled

  • Attempted to perform a span selection across multiple types

ExpandHeader

Description

Expands the identified header.

Parameters

The following table summarizes the method’s parameters followed by code examples where applicable.

Parameter Description

oeHeaderType

Contains enumerated value, string name, or integer value representing the HeaderType via the PvtGHeaderType enumeration.

oHeaderArg

Contains Integer index, string array of the text path, or two-dimensional array of integer’s row, column position that represents the location of the appropriate header.

Example

Expands the first row:

SwfTable("Identifier").ExpandHeader pvtgHeaderRow, 0

Expands the row header, All Periods, CY 2001, H2 CY 2001, Q3 CY 2001:

SwfTable("Identifier"). ExpandHeader pvtgHeaderRow, ARRAY(“All Periods”, “CY 2001”, “H2 CY2001”, “Q3 CY 2001”)

Possible exceptions

The following list contains the possible exceptions to this method and their likely causes.

  • The supplied option is invalid options; the only valid options are [pvtgHeaderRow, pvtgHeaderColumn].

  • The specified {0} index [{1}] is out of range.

  • The following {0} [{1}] was not found.

  • Cannot expand the header supplied.

CollapseHeader

Description

Collapses the identified header.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeHeaderType

Contains enumerated value, string name, or integer value representing the HeaderType via the PvtGHeaderType enumeration.

oHeaderArg

Contains Integer index, string array of the text path, or two-dimensional array of integer’s row, column position that represents the location of the appropriate header.

Example

Collapses the row header at row 0, column 2:

SwfTable("Identifier").CollapseHeader pvtgHeaderRow, ARRAY(0, 2)

Collapses the row header, All Periods, CY 2001, H2 CY 2001:

SwfTable("Identifier"). CollapseHeader pvtgHeaderRow, ARRAY(“All Periods”, “CY 2001”, “H2 CY 2001”)

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The option supplied is not one of the valid options; valid options are [pvtgHeaderRow, pvtgHeaderColumn].

  • The specified {0} index [{1}] is out of range.

  • The following {0} [{1}] was not found.

  • Cannot collapse the header supplied.

ResizeHeader

Description

Resizes the identified header.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeHeaderType

Contains enumerated value, string name, or integer value representing the HeaderType via the PvtGHeaderType enumeration.

oHeaderArg

Contains Integer index, string array of the text path, or two-dimensional array of integer’s row, column position that represents the location of the appropriate header.

[Optional] oiNewSize

If oiNewSize is blank (size not provided) it will auto-size the width, otherwise the new size will be applied to the header.

Note
NOTE:

The current (14.1) implementation does not allow row headers resizing, only columns.

Example

Auto-size the second column:

SwfTable("Identifier").ExpandHeader pvtgHeaderColumn, 1

Sets the column header width to 200, “All Periods”, “CY 2001”, “H2 CY 2001”, and “Q3 CY 2001”.

SwfTable("Identifier"). ExpandHeader pvtgHeaderColumn, ARRAY(“All Periods”, “CY 2001”, “H2 CY2001”, “Q3 CY 2001”), 200

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The option supplied is not one of the valid options, valid options are [pvtgHeaderRow, pvtgHeaderColumn]

  • The specified {0} index [{1}] is out of range

  • The following {0} [{1}] was not found.

  • Cannot resize the header supplied.

RemoveDropItem

Description

Clicks to remove the DropItem from the PivotGrid DropItemArea.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeDropItemArea

Contains enumerated value, string name, or integer value representing the DropItem area via the PvtGDropItemArea enumeration.

oDropItemArg

Contains string visible text, string Key, or integer index of a DropItem.

Example

Remove the DropItem:

SwfTable("Identifier").RemoveDropItem pvtgColumnArea, “Category”

Remove the first measure DropItem:

SwfTable("Identifier"). RemoveDropItem pvtgMeasureArea, 0

Possible exceptions

The following is the only possible exception to this method and the likely reason causing it:

The option supplied is not one of the valid options; valid options are [pvtgFilterArea, pvtgMeasureArea, pvtgRowArea, pvtgColumnArea].

DropdownDropItemFilter

Description

Drops down the filter of the identified DropItem.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeDropItemArea

Contains enumerated value, string name, or integer value representing the DropItem area via the PvtGDropItemArea enumeration.

oDropItemArg

Contains string visible text, string Key, or integer index of a DropItem.

Example

Drops down the filter for the Column DropItem Category:

SwfTable("Identifier").DropdownDropItemFilter pvtgColumnArea, “Category”

Drops down the filter of the first measure DropItem:

SwfTable("Identifier"). DropdownDropItemFilter pvtgMeasureArea, 0

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The option supplied is not one of the valid options; valid options are [pvtgFilterArea, pvtgMeasureArea, pvtgRowArea, pvtgColumnArea].

  • Filtering not enabled for [oDropItemArg].

CloseupDropItemFilter

Description

Closes up the filter of the identified DropItem.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeDropItemArea

Contains enumerated value, string name, or integer value representing the DropItem area via the PvtGDropItemArea enumeration.

oDropItemArg

Contains string visible text, string Key, or integer index of a DropItem.

Example

Closes up the Filter for the Column DropItem Category:

SwfTable("Identifier").DropdownDropItemFilter pvtgColumnArea, “Category”

Closes up the filter of the first measure DropItem:

SwfTable("Identifier").DropdownDropItemFilter pvtgMeasureArea, 0

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The option supplied is invalid options; valid options are [pvtgFilterArea, pvtgMeasureArea, pvtgRowArea, pvtgColumnArea].

  • Filtering disenabled for [oDropItemArg].

DragSubItem

Description

Starts a drag operation on the specified sub item by pressing and holding the left mouse button down on it, and moving the cursor.

Note
Note:

a drop action needs to follow the drag action in order to be completely successful (See Recorded By:).

Note
In addition:

The base implementation of the WinPivotGrid disables dragging elements on the grid; its intention is only to provide dragging from the DataSelector on to the grid.

Recorded By:

Hold the mouse down on a sub item (from DataSelector) and start a drag action on to the grid.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeSubItemType

Contains enumerated value, string name, or integer value representing the type of sub item via the PvtGSubItemType enumeration.

oSubItem

A single value that represents the sub item of the defined type as:

  • Row\Column Headers, it is similar to oRowArg\oColumnArg

  • Cells, it is an array of oRowArg, and oColumnArg

  • DropArea, it is the PvtGDropItemArea enumerated value

  • DropAreaItem, it is an array of the PvtGDropItemArea enumerated value, and oDropItemArg

[Optional] oeRegion

Contains enumerated value, string name, or integer value used to define a relative mouse point via the PvtGSubItemType and QTPRectRegion enumerations.

[Optional] oInt1, oInt2

Represents integer value offset to define a relative mouse point. It is dependent on the oeRegion parameter.

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • Option [{oRegion}] is not one of the valid options.

  • Option [{oeSubItemType}] is not one of the valid options.

  • The following {eSubItemType} [{oSubItem}] was not found.

  • {oSubItem} is not visible.

DropOnSubItem

Description

Finishes a drag operation dropping on the specified sub item by moving the cursor over the sub item, then releasing the left mouse button.

Note
Note:

The drop action needs to be proceeded by successful initiation of a drag action to be completed successfully (See Recorded By:).

Recorded By:

After starting a drag action, move the cursor over the tree node on the DataSelector , and release the mouse button.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeSubItemType

Contains enumerated value, string name, or integer value representing the type of sub item via the PvtGSubItemType enumeration.

oSubItem

A single value representings the sub item of the defined type.

  • For Row\Column Headers it is similar to oRowArg\oColumnArg.

  • For Cells, it is an array of oRowArg, and oColumnArg.

  • For DropArea it is PvtGDropItemArea enumerated value.

For DropAreaItem it is an array of PvtGDropItemArea enumerated value, and oDropItemArg .

[Optional] oeRegion

Contains enumerated value, string name, or integer value used to define a relative mouse point via the PvtGSubItemType and QTPRectRegion enumerations.

[Optional] oInt1, oInt2

Represents integer value offset to define a relative mouse point. It is dependent on the oeRegion parameter.

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • Option [{oRegion}] is not one of the valid options.

  • Option [{oeSubItemType}] is not one of the valid options.

  • The following {eSubItemType} [{oSubItem}] was not found.

  • {oSubItem} is not visible.

DropOnControl

Description

Finishes a drag operation dropping on the specified section of the source control by moving the cursor over the supplied location, then releasing the mouse button.

Note
Note:

The drop action needs to be preceded by successful initiation of a drag action to be completed successfully (See Recorded By:).

Recorded By:

After starting a drag action, move the cursor over the tree node on the DataSelector, and release the mouse button.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

[Optional] oeRegion

Contains enumerated value, string name, or integer value used to define a relative mouse point via the PvtGSubItemType and QTPRectRegion enumerations.

[Optional] oInt1, oInt2

Represents integer value offset to define a relative mouse point. It is dependent on the oeRegion parameter.

Possible exceptions

The following is the only possible exception to this method and the likely reason causing it.

Option [{oRegion}] is not one of the valid options.

ScrollDropArea

Description

Scrolling a drop area, one DropItem in the supplied direction.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeDropItemArea

Contains enumerated value, string name, or integer value representing the DropItem area via the PvtGDropItemArea enumeration.

oeScrollDirection

Contains enumerated value, string name, or integer value used to define the scroll direction you want to scroll via the QTPScrollDirection enumeration.

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The option supplied is not one of the valid options; valid options are [pvtgFilterArea, pvtgMeasureArea, pvtgRowArea, pvtgColumnArea].

  • The option supplied is not one of the valid options; valid options are [micScrollLeftOrUp, micScrollRightOrDown].

WinPivotGrid Replay-Only Actions

GetRowPathOfActiveCell

Description

Returns a delimited string of the row path for the active cell.

GetColumnPathOfActiveCell

Returns a delimited string of the column path for the active cell.

GetCellData

Returns the value for the supplied cell.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oRowArg oColumnArg

Contains Integer index, string array of the text path, or two-dimensional array of integer’s row, column position that represents the location of the appropriate header.

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The option supplied is not one of the valid options, valid options are [pvtgHeaderRow, pvtgHeaderColumn]

  • The specified {0} index [{1}] is out of range

  • The following {0} [{1}] was not found.

GetCellFormattedData

Description

Returns the formatted value for the supplied cell.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oRowArg oColumnArg

Contains Integer index, string array of the text path, or two-dimensional array of integer’s row, column position that represents the location of the appropriate header.

Possible exceptions

The following list contains the possible exceptions to this method and the likely reason causing them.

  • The option supplied is not one of the valid options, valid options are [pvtgHeaderRow, pvtgHeaderColumn]

  • The specified {0} index [{1}] is out of range

  • The following {0} [{1}] was not found.

GetColumnCount

Description

Returns the count of columns.

GetRowCount

Returns the count of rows.

GetItemsInDropArea

Retrieves the drop items for a drop area.

Parameters

The following table summarizes the methods parameters followed by code examples where applicable.

Parameter Description

oeDropItemArea

Contains enumerated value, string name, or integer value representing the DropItem area via the PvtGDropItemArea enumeration.

Possible exceptions

The following is the only possible exception to this method and the likely reason causing it.

The option supplied is not one of the valid options; valid options are [pvtgFilterArea, pvtgMeasureArea, pvtgRowArea, pvtgColumnArea].

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides information about the WinPivotGrid control’s actions that are executed with user interaction.

This topic provides reference information on the common enumerations used for testing the WinPivotGrid control.