Partilhar via


Propriedade do RDL NamingTemplate

Gets or sets how levels are named in a parent-child hierarchy constructed from the DimensionAttribute object.

Namespace:  Microsoft.AnalysisServices
Assembly:  Microsoft.AnalysisServices (em Microsoft.AnalysisServices.dll)

Sintaxe

'Declaração
Public Property NamingTemplate As String
    Get
    Set
'Uso
Dim instance As DimensionAttribute
Dim value As String

value = instance.NamingTemplate

instance.NamingTemplate = value
public string NamingTemplate { get; set; }
public:
property String^ NamingTemplate {
    String^ get ();
    void set (String^ value);
}
member NamingTemplate : string with get, set
function get NamingTemplate () : String
function set NamingTemplate (value : String)

Valor da propriedade

Tipo: System. . :: . .String
A string that defines how levels are named in a parent-child hierarchy constructed from the DimensionAttribute object.

Comentários

The value of the NamingTemplate property is used only by parent attributes (that is, the value of the Usage is set to Parent).

When a parent attribute is used to construct a hierarchy, the levels of the hierarchy are determined by the parent-child relationships between members contained by the parent attribute. Therefore, unlike other dimensions, the level names cannot be drawn from the attribute names that are used for the hierarchy.

Instead, a naming template is used to generate level names for parent-child hierarchies. The NamingTemplate property, defined in the parent attribute, contains a string expression used to define level names. There are two ways to define a naming template for a parent attribute. You can either design a naming pattern, or you can specify a list of names.

A naming pattern contains an asterisk (*) as a placeholder character for a counter that is incremented and inserted into the name of each new and deeper level. For example, using Level * results in the level names Level 01, Level 02, Level 03, and so on, if no (All) level is defined. If a naming pattern does not contain the placeholder character, it is first used as is, and then subsequent level names are formed by appending a space and a number to the end of the pattern. For example, using Level results in the level names Level, Level 01, Level 02, and so on.

To use a specific set of names for the naming, the value of the NamingTemplate property is set to a semicolon-delimited list of level names. Each name in the list is used for a subsequent level name. If the number of levels exceeds the number of names in the list, the last name in the list is used as a template for any additional level names, with a space and ordinal number appended to the last name as described earlier. For example, using Division;Group;Unit results in the level names Division, Group, Unit, Unit 01, Unit 02, and so on. By contrast, using Division;Group;Unit * results in the level names Division, Group, Unit 03, Unit 04, and so on.

Each name in the list is treated as a template to ensure uniqueness of level names. For example, using Manager;Team Lead;Manager;Team Lead;Worker * results in the level names Manager, Team Lead, Manager 01, Team Lead 01, Worker 05, Worker 06.

Use two asterisks (**) to include the asterisk (*) character in a level name as part of a naming template.