Category / Section
How to get the dropped measure name in OLAP Client?
This KB illustrates that how to get the dropped measure name in OLAP Client.
Solution
You can get the dropped measure name in OLAP Client by using the following codes.
C#
void OlapClient1_PreRender(object sender, EventArgs e)
{
var measureNode = this.Page.Request.Form["__EVENTARGUMENT"];
if (measureNode != null && measureNode.Contains("TreeNode___" + this.OlapClient1.OlapDataManager.CurrentCubeName + "\\\\Measures"))
{
string[] items = measureNode.Split(new string[] { "\\", "_" }, StringSplitOptions.RemoveEmptyEntries);
foreach (Syncfusion.Olap.Data.Measure measure in this.OlapClient1.OlapDataManager.CurrentCubeSchema.Measures)
{
if (measure.Caption == items[items.Count() - 1])
{
//// UniqueName of dropped MeasureElement
var respectiveUniqueName = measure.UniqueName;
}
}
}
}
VB
Private Sub OlapClient1_PreRender(ByVal sender As Object, ByVal e As EventArgs)
Dim measureNode = Me.Page.Request.Form("__EVENTARGUMENT")
If measureNode IsNot Nothing AndAlso measureNode.Contains("TreeNode___" & Me.OlapClient1.OlapDataManager.CurrentCubeName & "\\Measures") Then
Dim items() As String = measureNode.Split(New String() { "\", "_" }, StringSplitOptions.RemoveEmptyEntries)
For Each measure As Syncfusion.Olap.Data.Measure In Me.OlapClient1.OlapDataManager.CurrentCubeSchema.Measures
If measure.Caption = items(items.Count() - 1) Then
'// UniqueName of dropped MeasureElement
Dim respectiveUniqueName = measure.UniqueName
End If
Next measure
End If
End Sub