Share via


Attribute Object (Model Designer)

The Attribute object defines an item within an entity. This object also inherits properties from the Field object.

Properties

Name Cardinality Type Description

Name

1

String

The name of the item. Note that this is a required string if the attribute does not have an expression.

DataType

1

DataTypeEnum

The data type of the attribute. If an expression is present, the DataType value must match the DataType value of the expression.

Nullable

0-1

Boolean

Indicates whether the attribute can have a null value.

Expression

0-1

Object

The expression used to calculate the value of the attribute. A scalar value must be returned.

SortDirection

0-1

Enum

The default direction on which to sort by when sorting on this attribute. By default, ascending is specified.

Width

0-1

Integer

The default column width, in characters, for displaying the attribute. The value must be greater than 0. The default is based on DataType and has the following values: Boolean: 6, DateTime: 10, Integer: 8, Decimal: 8, Float: 8, String: 20, Binary: 1023, EntityKey: 128.

Alignment

0-1

Enum

The default character alignment. The default is General. Other possible values are Left, Center or Right.

MimeType

0-1

String

The MIME type of the attribute. For non-binary attributes, this value is ignored. You cannot specify an empty string.

DataCulture

0-1

Language

Indicates the culture to use for culture-sensitive operations; for example, by formatting numerical data with a currency symbol. This culture attribute is not used for simple display formatting, such as for date or numeric formats. If not specified, the default value of DataCulture is the model's culture value used in Model.Culture.

DiscourageGrouping

0-1

Boolean

Indicates whether the client application should discourage the user from grouping on this attribute. DiscourageGrouping should be set on fields with unique values, for example, phone numbers. If the attribute is a key or identifying attribute of the entity, the client application groups on the entity's key attributes instead.

EnableDrillthrough

0-1

Boolean

Indicates whether the client application should provide a drillthrough link from this attribute to the containing entity.

Format

0-1

String

Specifies the default .NET Framework format string used to format the value of the attribute. Besides the standard .NET Framework formats, the following format strings are supported:

Format Strings for Date Integers

  • ddd: day of week abbreviation
  • dddd: full day of week name
  • MMM: month abbreviation
  • MMMM: full month name

Format Strings for Booleans

  • truefalse: "True" and "False"
  • yesno: "Yes" and "No"

Custom Format Strings for Booleans

Custom format strings take the form "truevalue;falsevalue".

  • true: "True"
  • false: "False"
  • yes: "Yes"
  • no: "No"
  • " and ' Characters enclosed in single or double quotes are copied to the result string literally, and do not affect formatting.
  • \ Escape Character - The character that follows the specified escape character is treated as a literal character, not a format specifier.

ContextualName

0-1

Enum

Defines how the client application should generate a context-sensitive name for this attribute when the entity is reached by using a role. The enumerator can be one of three values: Attribute, Merge or Role. The enumerator value defaults to Attribute which uses the attribute name as the contextual name. Specifying Merge causes the attribute name and role name to be merged and used as the contextual name. If this attribute is the single identifying attribute of the entity, specifying Role uses the role name as the contextual name. If it is not the single identifying attribute of the entity, Role is treated like Merge.

IsAggregate

0-1

Boolean

Indicates whether this attribute is an aggregate that can be calculated in the context of not just the containing entity, but also any other entity for which there is a one to many relationship within the containing entity. If this is not set, the attribute is treated as a scalar. IsAggregate can be true only for attributes with non-anchored expressions.

IsFilter

0-1

Boolean

Indicates that this attribute is intended for use as a named filter. Can be true only for Boolean attributes.

OmitSecurityFilters

0-1

Boolean

Indicates that the expression for this attribute should be calculated without adding security filters. Typically used for cases where detail data must be secured based on security filters but aggregate data is public. This property is ignored when the attribute does not have an expression.

DefaultAggregateAttributeID

0-1

String

The ID of an attribute that is the default aggregate for this attribute. This string must be the ID of a Variation of this attribute. This string is not allowed if IsAggregate is True. The value is ignored if the attribute is hidden.

ValueSelection

0-1

Enum

Determines the client application behavior for selecting values of the attribute, based on the expected number of unique values. Three options are available: None, Dropdown, and List. By default, None is selected, which requires the user to type in a value. When Dropdown is specified, the unique values are displayed in a simple drop-down list. When List is specified, the unique values are displayed in the UI as a list. If IsAggregate is True, this attribute is ignored.

Binding

0-1

Object

The database object that represents this field. This object is required if the attribute does not have an expression. The binding must be bound to a column in the table to which the containing entity is bound, or to the column to which the entity is bound.

Remarks

  • In Report Builder, an attribute is called a field.
  • To prevent all unique values of a field from being retrieved in a value selection interface, such as the Filter Data dialog box or the parameter area, make sure to set the ValueSelection property to None. The user will be required to type in a value.
  • When using functions that can return Null, you must set the Nullable property for the attribute to True.
  • When the ValueSelection property is set to List, all values are displayed to the Report Builder user as sorted lists. However, when a prompted filter condition is created, the parameter list of values might not be sorted because the semantic query does not perform sorts on parameter value queries. If your list of parameter values is not sorted and you want it to be, try to create an index on the field in the underlying database; this will often cause the list to be sorted.
  • To create a group on the entity instead of on the field when adding the field to the Report Builder report layout, you can set the DiscourageGrouping property to True for the field. This property should be set to true only for unique attributes.

For more information about valid enumeration values, see Model Designer Data Types.

See Also

Concepts

Model Designer
Model Designer Object Properties
Ad Hoc Reporting with Report Models
Working with Model Designer

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

17 July 2006

New content:
  • Remarks: Controlling unique instances of a field.

14 April 2006

New content:
  • Added content to the Remarks section.