FindAndAdd (Method)

Applies To:

QueryLabel object

Description:

Adds the specified member to the label.

Syntax:

Expression.FindAndAdd(MemberName as String, AddAll as Boolean)

If the member does not have a unique name, then the first member with the given name is added if AddAll is false, otherwise all instances of the member are added.

The "*" character may be used as a wild-card in the MemberName argument.

If an alias table is in use, the member may be specified using the aliases, for example "Cola" instead of "100-10".

An ItemNotFound exception will be thrown if the supplied member name does not exist.

Example:

This example shows various methods for finding and adding members to the Product label.

// Add the first instance of member 100-20 to the Product label.
Sections["Query"].Columns["Product"].FindAndAdd("100-20");

// Add all instances of member 100-20 to the Product label.
Sections["Query"].Columns["Product"].FindAndAdd("100-20", true);

// Add all instances of members starting with 100- to the Product label.
Sections["Query"].Columns["Product"].FindAndAdd("100-*", true);

// Assuming an alias table is in use, add all instances of members
// starting with "Cola" to the Product label.
Sections["Query"].Columns["Product"].FindAndAdd("Cola*", true);