This topic provides a conceptual overview of how to manipulate data at runtime for those controls using the OlapViewModel.
This topic contains the following sections:
To record AddPivotItem action on the OlapViewModel , first you need to interact with one of the following four control areas :
Measures
Rows
Columns
Filters
Recording the AddPivotItem action is always from the xamPivotDataSelector even if adding the item to another control for instance, xamPivotGrid . Hence, you need to ensure that you click on any of the four areas mentioned above so that you are able to record AddPivotItem
action.
The following table briefly explains the recordable and replayable methods for testing the control. Additional information about each method is available following the table.
Legend:
– Record in UFT (default)
– Replay in UFT (using script)
Storing a pivot item’s identifier that is added (Tree node identifier), the target area name and the target index where the item is added.
The following table explains the method’s parameters followed by code example.
The following example demonstrates how to add a tree node with header = “Child1”
under the root node with header = “Root”
to the target area with rows at target index of 1.
XamPivotGrid("xamPivotGrid1").AddPivotItem Array(“Root”, “Child1”), pvtRows, 1
The following example demonstrates how to add a child tree node at index 2 under the root node at index 0 to the target area with measures at target index of 0.
XamPivotGrid("xamPivotGrid1").AddPivotItem Array(0,2), pvtMeasures, 0
The following example demonstrates how to add a root tree node at index 2 to the target area with filters at target index of 2.
XamPivotGrid("xamPivotGrid1").AddPivotItem 2, pvtFilters, 2
The following example demonstrates how to add a root tree node with header=”Root2”
to the target area with columns at the end of the existing collection.
XamPivotGrid("xamPivotGrid1").AddPivotItem “Root2”, pvtColumns
The following table lists the possible exceptions for the method and the reason that is likely to be causing them.
Storing the moved pivot item’s source area name and identifier, along with the target area name and the target index where the item is moved.
The following table explains the method’s parameters followed by code example.
The following example shows how to move the, “Sales” pivot item from the source area (Columns) to target area (Rows) at a target index of 1.
XamPivotGrid("xamPivotGrid1").MovePivotItem pvtColumns, “Sales”, pvtRows, 1
The following example shows how to move the, “Sales measures” pivot item from the source area (Measures) to target area (Measures) within the same area at a target index of 2.
XamPivotGrid("xamPivotGrid1").MovePivotItem pvtMeasures, “Sales measures”, pvtMeasures, 2
The following example shows how to move the pivot item at index 3 from the source area (Rows) to target area (Filters) at a target index of 2.
XamPivotGrid("xamPivotGrid1").MovePivotItem pvtRows, 3, pvtFilters, 2
N/A
The following table lists the possible exceptions for the method and the reason that is likely to be causing them.
Stores the pivot item, to be removed, source area’s name and identifier.
The following table explains the method’s parameters followed by code example.
The following example demonstrates an action for removing the pivot item, “Sales” from the source area: Columns.
XamPivotGrid("xamPivotGrid1").RemovePivotItem pvtColumns, “Sales”
The following table lists the possible exceptions for the method and the reason that is likely to be causing them.
Stores the pivot item source area’s name and identifier whose filter dialog is opened or closed.
The following table explains the method’s parameters followed by code example.
Demonstrates opening of the xamPivotDataSelector control’s, “Products” item in the “Columns” area filter dialog.
XamPivotDataSelector("dataSelector").OpenFilterDialog pvtColumns, "Product"
The following table lists the possible exceptions for the method and the reason that is likely to be causing them.
Stores the pivot item source area’s name and identifier whose filter dialog is closed.
The following table explains the method’s parameters followed by code example.
Demonstrates closing of the, “Products” item in the, “Columns” area filter dialog of the xamPivotDataSelector control.
XamPivotDataSelector("dataSelector").CloseFilterDialog pvtColumns, "Product"
The following table lists the possible exceptions for the method and the reason that is likely to be causing them.
The following topics provide additional information related to this topic.