Articles in this section
Category / Section

How to provide support for a dynamic filtering in OlapGrid Control

1 min read

The Dynamic filtering feature has been supported in OlapGrid Control. This can be achieved by giving the corresponding Level name in the OlapReport at runtime.

Please refer the below code snippet to achieve.




/// <summary>
/// Here the "productName" is the corresponding level name.
/// </summary>
/// <returns>Returns the olap report.</returns>
        private OlapReport DynamicReport(string productName)
            OlapReport olapReport = new OlapReport();
            olapReport.Name = "DynamicFilterSample";
            olapReport.CurrentCubeName = "Adventure Works";
            DimensionElement dimensionColumn = new DimensionElement();
            dimensionColumn.Name = "Product";
            dimensionColumn.AddLevel("Product Categories", "Category");
            if (productName != "All")
                dimensionColumn.Hierarchy.LevelElements["Category"].IncludeAvailableMembers = true;
            MeasureElements meansureElements = new MeasureElements();
            meansureElements.Elements.Add(new MeasureElement() { Name = "Reseller Order Quantity"} );
            DimensionElement dimensionRow = new DimensionElement();
            dimensionRow.Name = "Date";
            dimensionRow.AddLevel("Fiscal", "Fiscal Year");
            return olapReport;



Figure: OlapGrid with filtered report



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