Member Properties are now Supported | Syncfusion Blogs
Detailed Blog page Skeleton loader

Member properties cover the basic information about each member in each tuple. This basic information includes the member name, parent level, the number of children, and so on. Member properties are available for all members at a given level. Now OlapGrid accepts dimension members along with their properties.

Defining report with Member Properties

In order to display member properties along with the dimension member in OlapGrid, we have to define member properties in the respective dimension element.

Sample report below

private OlapReport GetReportWithMemberProperties()
{
    OlapReport olapReport = new OlapReport();
    // Specifying the current cube name
    olapReport.CurrentCubeName = "Adventure Works";

    MeasureElements measureElementColumn = new MeasureElements();
    // Specifying the Name for the Measure Element
            measureElementColumn.Elements.Add(new MeasureElement { Name = "Sales Amount Quota" });
            DimensionElement dimensionElementRow = new DimensionElement();
            // Specifying the Dimension Name
            dimensionElementRow.Name = "Employee";
            // Specifying the Hierarchy and level name for the Dimension Element
            dimensionElementRow.AddLevel("Employees", "Employee Level 02");
            dimensionElementRow.Hierarchy.LevelElements["Employee Level 02"].IncludeAvailableMembers = true;
            // Adding the Member properties to the Dimension Element along with the property name and unique name
            dimensionElementRow.MemberProperties.Add(new MemberProperty("Title", "[Employee].[Employees].[Title]"));
            dimensionElementRow.MemberProperties.Add(new MemberProperty("Phone", "[Employee].[Employees].[Phone]"));
            dimensionElementRow.MemberProperties.Add(new MemberProperty("Email Address", "[Employee].[Employees].[Email Address]"));

            // Adding Row Members
            olapReport.SeriesElements.Add(dimensionElementRow);
            // Adding Column Members
            olapReport.CategoricalElements.Add(measureElementColumn);
      return olapReport;

 }

To display member properties in grid we have to set the layout as ExcelLikeLayoutWithMemberProperties

/// Setting Grid Layout as ExcelLikeLayoutWithMemberProperties 
this.OlapGrid1.Layout = GridLayout.ExcelLikeLayoutWithMemberProperties;

Sample screenshot below. Here Title, Phone and Email Address are the member properties.

image

You can also view the member properties as tooltip in header cells with normal layout by setting the following property.

/// Setting the Grid Layout as Normal 
this.OlapGrid1.Layout = GridLayout.Normal;

// To Display Member Properties in ToolTip
this.OlapGrid1.ShowMemberPropertiesToolTip = true;

image

Be the first to get updates

Tres Watkins

Meet the Author

Tres Watkins

Tres Watkins oversees Syncfusion's content development and editorial team to deliver an accessible, uncomplicated reader experience. He has worked in publishing for 15 years, where he honed his craft of communicating essential information to target audiences. He holds a bachelor's degree in communications from Appalachian State University