Subordinate Objects

ViewItem

 

ViewItem is a subordinate object used to define an item selected for the view. One object is defined for each item selected. Items can be data source items or calculated items. The ViewItem object corresponds to a record in the pvxview.vue file.

For information on the pvxview.vue file structure, see Views System File Structures. Properties are read only and are set using corresponding Setxxx( ) methods.

ViewItem Properties

The following table lists the properties of the ViewItem subordinate object:

Property

Description

Column$

Column name (no trailing "$").

Condition$

(Internal Use Only)

Filter condition specific to the view item. Use ViewCtl SetFilter( ) method.

ItemType$

Indicates the source of the item where:

"I" or blank

Data source item

"C"

Calculated item

(ItemType$ property was added in PxPlus 2021.)

Path$

Source linkage.

For calculated items, linkage is to the CalcItem object ID.

For data source items, linkage consists of:

   [Link ObjID [+ Link ObjID …]] + DS_Item ObjID

Linkage begins just below the primary data source, resulting in the linkage for items from the primary data source consisting of the DS_Item ObjID alone.

RawCondition$

Raw condition data consisting of the condition code, case flag and up to eight comparison values all separated by $01$.

Example:

   Code$ + $01$ + Case$ + $01$ [+ v1$ + $01$ ...+ v8$ ]

See the SetCondition$( ) method for code and case flag values.

ViewItem Methods

The following table lists the methods of the ViewItem subordinate object:

Method

Description

SetColumn(Column$)

Set a column name (no trailing "$").

SetCondition(Code, Case [, v1$  v8$ ])
SetCondition(
Condition1$ | Condition2$)

Set a filter condition specific to the view item. (Use ViewCtlSetFilter( ) method.)

Code - Condition indicator code:

1

Equal to <Value1>

2

Not equal to <Value1>

3

Less than <Value1>

4

Greater than <Value1>

5

Less than or equal to <Value1>

6

Greater than or equal to <Value1>

7

Between <Value1> and <Value2> inclusive

8

Between <Value1> and <Value2> exclusive

9

Any of <Value1>,<Value1>, …<Value1>

10

None of <Value1>,<Value1>, …<Value1>

11

Contains <Value1>

12

Starts with <Value1>

Case - Case sensitivity indicator:

0

Not case sensitive

1

Case sensitive

v1$...v8$ - Values to be used in comparison. Pass numeric values as string arguments.

Condition1$
- A single string consisting of code, case and optional values separated by $01$.

Example:

   Code$+$01$+Case$+$01$ [ +v1$+$01$...+v8$ ]

The format of this condition matches the contents of the RawCondition$ property.

Condition2$ - A simple PxPlus conditional expression:

Example:

   CST_BALANCE>0

This format is not recommended, as it only supports a restricted number of expressions.

Note:
View item-level filters are analyzed at run time to optimize data retrieval by determining key ranges for reading records.

SetPath(Path$)

Set the source linkage.

For calculated items, the linkage is to the CalcItem object ID.

For data source items, linkage consists of:

   [Link ObjID [+ Link ObjID …]] + DS_ItemObjID

Linkage begins just below the primary data source, resulting in the linkage for items from the primary data source consisting of the DS_Item ObjID alone.

ViewItem objects must be grouped sequentially based on their linkage path. If it is possible that a ViewItem object is out of sequence based on the value in its Path$ property, use the ViewDefAdjustItemSequence( ) method to adjust the sequence of the objects.

SetType(Type$)

Set the type of data where:

"I" or blank

Data source item

"C"

Calculated item

(SetType method was added in PxPlus 2021.)