Articles in this section
Category / Section

How to rename the caption inside AxisElementBuilder

1 min read

This can be achieved using the AxisElementChanged event in the OlapDataManager. The caption for each MetaTreeNode has been renamed using this event. Please refer the below code snippet.


this.olapClient1.OlapDataManager.AxisElementChanged +=new AxisElementChangedEventHandler(OlapDataManager_AxisElementChanged);
void OlapDataManager_AxisElementChanged(object sender, AxisElementChangedEventArgs e)
private void RenameAll()
private void Rename( ObservableCollection<MetaTreeNode> MetaTreeNodes)
     foreach (MetaTreeNode node in MetaTreeNodes)
        var hierarchy = node.Properties.FindByName(PropertyConstants.Hierarchy);
        var dimension = node.Properties.FindByName(PropertyConstants.Dimension);
        if (dimension != null && hierarchy != null)
            node.Caption = (dimension.Value as Dimension).Name + "." + (hierarchy.Value as Hierarchy).Name;



 Private Me.olapClient1.OlapDataManager.AxisElementChanged += New AxisElementChangedEventHandler(AddressOf OlapDataManager_AxisElementChanged)
Private Sub OlapDataManager_AxisElementChanged(ByVal sender As Object, ByVal e As AxisElementChangedEventArgs)
End Sub
Private Sub RenameAll()
End Sub
Private Sub Rename(ByVal MetaTreeNodes As ObservableCollection(Of MetaTreeNode))
                 For Each node As MetaTreeNode In MetaTreeNodes
                                Dim hierarchy = node.Properties.FindByName(PropertyConstants.Hierarchy)
                                Dim dimension = node.Properties.FindByName(PropertyConstants.Dimension)
                                If dimension IsNot Nothing AndAlso hierarchy IsNot Nothing Then
                                                node.Caption = (TryCast(dimension.Value, Dimension)).Name & "." & (TryCast(hierarchy.Value, Hierarchy)).Name
                                End If
                 Next node
End Sub



Figure: OlapClient with renamed caption for “Date” in AxisElementBuilder

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment