How to find the default hierarchy name of a Dimension in JavaScript PivotGrid ?
This KB illustrates that how to find the default hierarchy name of a Dimension.
Solution:
You can find the default hierarchy name of a dimension from the Olap report by using the following code example.
C#
public Dictionary<string, object> InitializeClient(string action, string customObject, string clientParams) { OlapDataManager DataManager = null; DataManager = new OlapDataManager(connectionString); DataManager.SetCurrentReport(CreateOlapReport()); string defaultHierarchyName = ""; var Dimensions = DataManager.CurrentCubeSchema.Dimensions; for (int i = 0; i < Dimensions.Count; i++) { if(Dimensions[i].Name == "Enter valid dimension name") defaultHierarchyName = Dimensions[i].DefaultHierarchyName; } return olapClientHelper.GetJsonData(action, DataManager, clientParams); }
VB
Public Function InitializeClient(ByVal action As String, ByVal customObject As String, ByVal clientParams As String) As Dictionary(Of String, Object) Dim DataManager As OlapDataManager = Nothing DataManager = New OlapDataManager(connectionString) DataManager.SetCurrentReport(CreateOlapReport()) Dim defaultHierarchyName As String = "" Dim Dimensions = DataManager.CurrentCubeSchema.Dimensions For i As Integer = 0 To Dimensions.Count - 1 If Dimensions(i).Name = "Enter valid dimension name" Then defaultHierarchyName = Dimensions(i).DefaultHierarchyName End If Next i Return olapClientHelper.GetJsonData(action, DataManager, clientParams) End Function
I hope you enjoyed learning about how to find the default hierarchy name of a Dimension in JavaScript PivotGrid.
You can refer to our JavaScript PivotGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!