Category / Section
How to expand OLAP Grid and OLAP Chart in OLAP Client upto "n" level initially?
1 min read
You can expand OLAP Grid and OLAP Chart in OLAP Client up to the “n” level while loading, by using the following code example.
C#
OlapReport olapReport = new OlapReport(); olapReport.CurrentCubeName = "Adventure Works"; DimensionElement dimensionElement = new DimensionElement() { Name = "Product" }; dimensionElement.AddLevel("Product Categories", "Category"); olapReport.SeriesElements.Add(dimensionElement); dimensionElement = new DimensionElement() { Name = "Date" }; dimensionElement.AddLevel("Fiscal", "Fiscal Year"); dimensionElement.DrillState = DrillState.ExpandToLevel; dimensionElement.DrillUpDownLevel = "Month"; olapReport.CategoricalElements.Add(dimensionElement); return olapReport;
VB
Dim olapReport As OlapReport = New OlapReport() olapReport.CurrentCubeName = "Adventure Works" Dim dimensionElement As DimensionElement = New DimensionElement() With {.Name = "Product"} dimensionElement.AddLevel("Product Categories", "Category") olapReport.SeriesElements.Add(dimensionElement) Dim TempDimensionElement As DimensionElement = New DimensionElement() With {.Name = "Date"} dimensionElement = New DimensionElement() With {.Name dimensionElement.AddLevel("Fiscal", "Fiscal Year") dimensionElement.DrillState = DrillState.ExpandToLevel dimensionElement.DrillUpDownLevel = "Month" olapReport.CategoricalElements.Add(dimensionElement) Return olapReport