Class Column
Represents a base class of a column object of a Tabular model, used to specify a DataColumn, RowNumberColumn, CalculatedColumn, or CalculatedTableColumn.
Assembly: TOMWrapper.dll
Syntax
public abstract class Column : TabularNamedObject, ICustomTypeDescriptor, INotifyPropertyChanging, IComparable, IFolderObject, ITabularTableObject, ITomErrorMessageObject, IDescriptionObject, IFormattableObject, ILineageTagObject, IExtendedPropertyObject, ITabularPerspectiveObject, IHideableObject, ITranslatableObject, IAnnotationObject, ISynonymObject, IDaxObject, ITabularNamedObject, ITabularObject, INotifyPropertyChanged, INamedObject
Properties
Alignment
Specifies the text alignment of the column in report visualizations. The possible values are Default (1), Left (2), Right (3), Center (4).
Declaration
public Alignment Alignment { get; set; }
Property Value
AlternateOf
Gets or sets the Alternate Of configuration used to specify aggregations.
Declaration
public AlternateOf AlternateOf { get; set; }
Property Value
Annotations
The collection of Annotations on the current Column.
Declaration
[Browsable(true)]
public AnnotationCollection Annotations { get; }
Property Value
DataCategory
Specifies the type of data contained in the column so that you can add custom behaviors based on column type. There are 248 possible values. The first ten are Invalid (-1), All (1), Regular (2), Image (3), ImageBMP (4), ImageGIF (5), ImageJPG (6), ImagePNG (7), ImageTIFF (8), ImageURL (9), Id (10). For the rest, please refer to the MS-SSAS-T SQL Server Analysis Services Tabular Protocol documentation on MSDN.
Declaration
[TypeConverter(typeof(ColumnDataCategoryConverter))]
public string DataCategory { get; set; }
Property Value
DataType
Declaration
[TypeConverter(typeof(DataTypeEnumConverter))]
public DataType DataType { get; set; }
Property Value
DaxObjectFullName
Gets a fully qualified DAX reference to this column
Declaration
[Browsable(true)]
public string DaxObjectFullName { get; }
Property Value
DaxObjectName
Gets an unqualified DAX reference to this column
Declaration
[Browsable(false)]
public string DaxObjectName { get; }
Property Value
DaxTableName
Gets a DAX reference to the table on which this column resides
Declaration
[Browsable(false)]
public string DaxTableName { get; }
Property Value
Description
The description of the column, visible to developers at design time and to administrators in management tools, such as SQL Server Management Studio.
Declaration
public string Description { get; set; }
Property Value
DisplayFolder
Defines the display folder for the column, for use by clients.
Declaration
public string DisplayFolder { get; set; }
Property Value
DisplayOrdinal
Indicates the visual position of the column, defined as a relative ordering rather than a strict ordering (example: 10, 20, 40, 50). It allows client applications to maintain a consistent column position.
Declaration
public int DisplayOrdinal { get; set; }
Property Value
EncodingHint
This property allows an encoding hint to be specified for the column. A numeric column may use either value-based encoding or hash-based encoding. Usually the server will automatically attempt detect which encoding to use, but re-encoding may occur later. This property allows hinting to the server that it should start with a different encoding type.
Declaration
public EncodingHintType EncodingHint { get; set; }
Property Value
Remarks
ErrorMessage
A string that explains the error state associated with the current object. It is set by the engine only when the state of the object is one of these three values: SemanticError, DependencyError, or EvaluationError. It is applicable only to columns of the type Calculated or CalculatedTableColumn. It will be empty for other column objects.
Declaration
public string ErrorMessage { get; }
Property Value
ExtendedProperties
The collection of Extended Properties on the current Column.
Declaration
public ExtendedPropertyCollection ExtendedProperties { get; }
Property Value
A string that specifies the format of the column contents.
Declaration
[TypeConverter(typeof(FormatStringConverter))]
public string FormatString { get; set; }
Property Value
GroupByColumns
A collection of columns that should be grouped together with this column when used in visuals (RelatedColumnDetails).
Declaration
public GroupingColumnCollection GroupByColumns { get; }
Property Value
InPerspective
Declaration
[Browsable(true)]
public PerspectiveColumnIndexer InPerspective { get; }
Property Value
IsAvailableInMDX
A boolean value that indicates whether the column can be excluded from usage in MDX query tools. False if the column can be excluded from usage in MDX query tools; otherwise true.
Declaration
public bool IsAvailableInMDX { get; set; }
Property Value
IsDataTypeInferred
A boolean value indicating whether the datatype is inferred.
Declaration
public bool IsDataTypeInferred { get; set; }
Property Value
IsDefaultImage
A boolean value that indicates whether this column is returned as the DefaultImage property in CSDL.
Declaration
public bool IsDefaultImage { get; set; }
Property Value
IsDefaultLabel
A boolean value that indicates whether this column is included in the DisplayKey element in CSDL.
Declaration
public bool IsDefaultLabel { get; set; }
Property Value
IsHidden
A boolean value that indicates whether a column is treated as hidden by client visualization tools. True if the column is treated as hidden; otherwise false.
Declaration
public bool IsHidden { get; set; }
Property Value
IsKey
A boolean value that indicates whether the column is a key of the table. True if the column is a key of the table; otherwise false.
Declaration
public bool IsKey { get; set; }
Property Value
IsNullable
If false, the column cannot contain nulls. Even if true, it may still not allow nulls if it's a key column.
Declaration
public bool IsNullable { get; set; }
Property Value
IsUnique
A boolean value that indicates whether the column contains only unique values. True if the values are unique; otherwise false.
Declaration
public bool IsUnique { get; set; }
Property Value
IsVisible
Gets the visibility of the Column. Takes into consideration that a column is not visible if its parent table is hidden.
Declaration
[Browsable(false)]
public bool IsVisible { get; }
Property Value
KeepUniqueRows
Specifies the grouping behavior used for building a hierarchy. True groups by entity key. False groups by value.
Declaration
public bool KeepUniqueRows { get; set; }
Property Value
LineageTag
A tag that represents the lineage of the object.
Declaration
public string LineageTag { get; set; }
Property Value
Remarks
ObjectLevelSecurity
Gets the OLS settings applied to this column
Declaration
public ColumnOLSIndexer ObjectLevelSecurity { get; }
Property Value
ReferencedBy
Gets the list of objects that reference this column.
Declaration
[Browsable(false)]
public ReferencedByList ReferencedBy { get; }
Property Value
SortByColumn
Indicates that the column defining this property will be sorted by the values of the column referenced by this property.
Declaration
[TypeConverter(typeof(TableColumnConverter))]
public Column SortByColumn { get; set; }
Property Value
SourceLineageTag
A tag that represents the lineage of the source for the object.
Declaration
public string SourceLineageTag { get; set; }
Property Value
Remarks
SourceProviderType
The original data type of the column as defined in the language of the data source. This data type is used to generate queries directly against the data source, for example in DirectQuery mode.
Declaration
public string SourceProviderType { get; set; }
Property Value
State
Enumerates the state of the column. Possible values include the following. Ready (1) The column is queryable and has up-to-date data. NoData (3) The column is queryable but has no data. This state is applicable only to columns of the type Data. CalculationNeeded (4) The column is not queryable and needs to be refreshed (that is, recalculated) to become functional. This state applies only to columns of the type Calculated or CalculatedTableColumn. SemanticError (5) The column is in an error state because of an invalid expression. The column is not queryable. This state applies only to columns of the type Calculated or CalculatedTableColumn. EvaluationError (6) The column is in an error state because of an error during expression evaluation. The column is not queryable. This state applies only to columns of the type Calculated or CalculatedTableColumn. DependencyError (7) The column is in an error state because some of its calculation dependencies are in an error state. The column is not queryable. This state applies only to columns of the type Calculated or CalculatedTableColumn. Incomplete (8) Some parts of the column have no data, and the column needs to be refreshed to bring the data in. The column is queryable. This state applies only to columns of the type Data. SyntaxError (9) The column is in an error state because of a syntax error in its expression. The column is not queryable. This state applies only to columns of the type Calculated.
Declaration
public ObjectState State { get; }
Property Value
SummarizeBy
A value indicating the default function, if any, used to aggregate this field. The possible values are Default (1), None (2), Sum (3), Min (4), Max (5), Count (6), Average (7), DistinctCount (8). If unspecified, Default is assumed for numeric fields, None for all other fields.
Declaration
public AggregateFunction SummarizeBy { get; set; }
Property Value
Synonyms
Collection of localized synonyms for this Column.
Declaration
[Browsable(true)]
public SynonymIndexer Synonyms { get; }
Property Value
Table
The parent table of the current Column.
Declaration
[Browsable(false)]
public Table Table { get; }
Property Value
TableDetailPosition
Determines whether you can place this column in the DefaultDetails collection of the Table. This collection is an ordered set of Column types. A positive value indicates participation in the collection. The collection is sorted in ascending order of this element. The DefaultDetails collection is returned as part of the CSDL metadata returned by the DISCOVER_CSDL_METADATA operation.
Declaration
public int TableDetailPosition { get; set; }
Property Value
TranslatedDescriptions
Collection of localized descriptions for this Column.
Declaration
[Browsable(true)]
public TranslationIndexer TranslatedDescriptions { get; }
Property Value
TranslatedDisplayFolders
Collection of localized Display Folders for the current Column.
Declaration
[Browsable(true)]
public TranslationIndexer TranslatedDisplayFolders { get; }
Property Value
TranslatedNames
Collection of localized names for this Column.
Declaration
[Browsable(true)]
public TranslationIndexer TranslatedNames { get; }
Property Value
Type
Specifies the data binding. Values include Data (1) where the contents of this column come from a DataSource, Calculated (2) where the contents are computed from an expression after the Data columns have been populated, RowNumber (3) where the column is an internal column representing the row number, or CalculatedTableColumn (4) where tables that are based on a calculated expression will automatically infer and generate the columns in the table.
Declaration
[Browsable(false)]
public ColumnType Type { get; }
Property Value
UsedInAlternateOfs
Declaration
[Browsable(false)]
public IEnumerable<AlternateOf> UsedInAlternateOfs { get; }
Property Value
UsedInHierarchies
Enumerates all hierarchies in which this column is used as a level.
Declaration
[Browsable(false)]
public IEnumerable<Hierarchy> UsedInHierarchies { get; }
Property Value
UsedInLevels
Enumerates all hierarchy levels that are based on this column.
Declaration
[Browsable(false)]
public IEnumerable<Level> UsedInLevels { get; }
Property Value
UsedInRelationships
Enumerates all relationships in which this column participates (either as FromColumn or ToColumn).
Declaration
[Browsable(false)]
public IEnumerable<SingleColumnRelationship> UsedInRelationships { get; }
Property Value
UsedInSortBy
Enumerates all columns where this column is used as the SortBy column.
Declaration
[Browsable(false)]
public IEnumerable<Column> UsedInSortBy { get; }
Property Value
UsedInVariations
Declaration
[Browsable(false)]
public IEnumerable<Variation> UsedInVariations { get; }
Property Value
Variations
The collection of Variation objects on this Column.
Declaration
public VariationCollection Variations { get; protected set; }
Property Value
Methods
AddAlternateOf(Column, SummarizationType)
Marks this column as an alternate of a column in another table, for aggregation purposes. See AlternateOf.
Declaration
public AlternateOf AddAlternateOf(Column column = null, SummarizationType summarization = SummarizationType.Sum)
Parameters
Returns
AllowDelete(out string)
Derived classes should override this method to prevent an object from being deleted.
If left un-overridden, always returns TRUE and sets message to null.
Declaration
protected override bool AllowDelete(out string message)
Parameters
Type |
Name |
Description |
string |
message |
If an object CANNOT be deleted, this string should provide
a reason why. If an object CAN be deleted, this string may optionally provide a
suitable warning message that applies if the object is deleted immediately after
the call to CanDelete.
|
Returns
Type |
Description |
bool |
True if an object can be deleted. False otherwise.
|
Overrides
ClearAnnotations()
Removes all annotations from this object.
Declaration
public void ClearAnnotations()
ClearExtendedProperties()
Removes all Extended Properties from this object.
Declaration
public void ClearExtendedProperties()
GetAnnotation(int)
Gets the value of the annotation with the given index, assuming it exists.
Declaration
public string GetAnnotation(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
GetAnnotation(string)
Gets the value of the annotation with the given name. Returns null if no such annotation exists.
Declaration
public string GetAnnotation(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
GetAnnotations()
Gets a collection of all annotation names on the current Column.
Declaration
public IEnumerable<string> GetAnnotations()
Returns
GetAnnotationsCount()
Gets the number of annotations on the current Column.
Declaration
public int GetAnnotationsCount()
Returns
GetExtendedProperties()
Gets a collection of all ExtendedProperty names on the current object.
Declaration
public IEnumerable<string> GetExtendedProperties()
Returns
GetExtendedProperty(int)
Gets the value of the ExtendedProperty with the given index, assuming it exists.
Declaration
public string GetExtendedProperty(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
GetExtendedProperty(string)
Gets the value of the ExtendedProperty with the given name. Returns null if no such ExtendedProperty exists.
Declaration
public string GetExtendedProperty(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
GetExtendedPropertyCount()
Gets the number of ExtendedProperties on the current object.
Declaration
public int GetExtendedPropertyCount()
Returns
GetExtendedPropertyType(int)
Gets the type of the ExtendedProperty with the given index, assuming it exists.
Declaration
public ExtendedPropertyType GetExtendedPropertyType(int index)
Parameters
Type |
Name |
Description |
int |
index |
|
Returns
GetExtendedPropertyType(string)
Gets the type of the ExtendedProperty with the given name, assuming it exists.
Declaration
public ExtendedPropertyType GetExtendedPropertyType(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
GetNewAnnotationName()
Returns a unique name for a new annotation.
Declaration
public string GetNewAnnotationName()
Returns
GetNewExtendedPropertyName()
Returns a unique name for a new ExtendedProperty.
Declaration
public string GetNewExtendedPropertyName()
Returns
HasAnnotation(string)
Returns true if an annotation with the given name exists. Otherwise false.
Declaration
public bool HasAnnotation(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
HasExtendedProperty(string)
Returns true if an ExtendedProperty with the given name exists. Otherwise false.
Declaration
public bool HasExtendedProperty(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
Init()
Derived members should override this method to instantiate child objects
Declaration
protected override void Init()
Overrides
OnPropertyChanged(string, object, object)
Fired after a property is changed
Declaration
protected override void OnPropertyChanged(string propertyName, object oldValue, object newValue)
Parameters
Overrides
OnPropertyChanging(string, object, ref bool, ref bool)
Called before a property is changed on an object. Derived classes can control how the change is handled.
Throw ArgumentException within this method, to display an error message in the UI.
Declaration
protected override void OnPropertyChanging(string propertyName, object newValue, ref bool undoable, ref bool cancel)
Parameters
Type |
Name |
Description |
string |
propertyName |
Name of the changed property.
|
object |
newValue |
New value assigned to the property.
|
bool |
undoable |
Return false if automatic undo of the property change is not needed.
|
bool |
cancel |
Return true if the property change should not apply.
|
Overrides
RelateTo(string, string)
Creates a relationship from the current column to another column.
Declaration
public SingleColumnRelationship RelateTo(string tableName, string columnName)
Parameters
Returns
Exceptions
RelateTo(Column)
Creates a relationship from the current column to another column.
Declaration
public SingleColumnRelationship RelateTo(Column column)
Parameters
Type |
Name |
Description |
Column |
column |
|
Returns
Exceptions
RemoveAlternateOf()
Declaration
public void RemoveAlternateOf()
RemoveAnnotation(string)
Remove an annotation by the given name.
Declaration
public void RemoveAnnotation(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
RemoveExtendedProperty(string)
Remove an ExtendedProperty by the given name.
Declaration
public void RemoveExtendedProperty(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
SetAnnotation(int, string)
Sets the value of the annotation with the given index, assuming it exists.
Declaration
public void SetAnnotation(int index, string value)
Parameters
SetAnnotation(string, string)
Sets the value of the annotation having the given name. If no such annotation exists, it will be created. If value is set to null, the annotation will be removed.
Declaration
public void SetAnnotation(string name, string value)
Parameters
SetExtendedProperty(int, string, ExtendedPropertyType)
Sets the value of the ExtendedProperty with the given index, optionally specifiying the type (string or JSON) of the ExtendedProperty.
Declaration
public void SetExtendedProperty(int index, string value, ExtendedPropertyType type)
Parameters
SetExtendedProperty(string, string, ExtendedPropertyType)
Sets the value of the ExtendedProperty having the given name. If no such ExtendedProperty exists, it will be created. If value is set to null, the ExtendedProperty will be removed.
Declaration
public void SetExtendedProperty(string name, string value, ExtendedPropertyType type)
Parameters
Implements
Extension Methods