How to render PivotGrid with SSAS Tabular model?
This KB document explains how to render PivotGrid with SSAS Tabular model.
Solution:
You can render the PivotGrid control in tabular model by using the following code snippets.
OLAP client mode:
JavaScript
$("#PivotGrid1").ejPivotGrid({
dataSource: {
data: "http://localhost/OLAP/msmdpump.dll",
catalog: "Adventure Works DW Tabular",
cube: "Internet Sales",
rows: [{
fieldName: "[Date].[Fiscal]"
}],
columns:
[{
fieldName: "[Customer].[First Name]"
}],
values:
[{
measures: [{
fieldName: "[Measures].[Internet Total Sales]",
}],
axis: "columns"
}]
}
});
MVC
@Html.EJ().Pivot().PivotGrid("PivotGrid1").DataSource(dataSource => dataSource.Rows(rows=>{rows.FieldName("[Date].[Fiscal]").Add();}).Columns(columns=>{columns.FieldName("[Customer].[First Name]").Add();}).Values(values => { values.Measures(measures => { measures.FieldName("[Measures].[Internet Total Sales]").Add(); }).Axis(AxisName.Column).Add();}).Data("https://bi.syncfusion.com/olap/msmdpump.dll").Catalog("Adventure Works DW Tabular").Cube("Internet Sales"))
ASP
<ej: <ej:PivotGrid ID="PivotGrid1" runat="server"> <DataSource Catalog="Adventure Works DW Tabular" Cube="Internet Sales" Data="http://localhost/OLAP/msmdpump.dll"> <Rows> <ej:Field FieldName="[Date].[Fiscal]"></ej:Field> </Rows> <Columns> <ej:Field FieldName="[Customer].[First Name]"></ej:Field> </Columns> <Values> <ej:Field Axis="Column"> <Measures> <ej:MeasuresItems FieldName="[Measures].[Internet Total Sales]" /> </Measures> </ej:Field> </Values> </DataSource> </ej:PivotGrid> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

PivotGrid in Tabular model-client mode
OLAP server mode:
You can give the following OLAP report for PivotGrid server mode rendering.
private OlapReport CreateOlapReport()
{
OlapReport olapReport = new OlapReport();
olapReport.CurrentCubeName = "Internet Sales";
MeasureElements measureElement = new MeasureElements();
measureElement.Elements.Add(new MeasureElement { UniqueName = "[Measures].[Distinct Count Sales Orders]" });
DimensionElement dimensionElementRow = new DimensionElement();
dimensionElementRow.Name = "Currency";
dimensionElementRow.AddLevel("Currency Name", "Currency Name");
olapReport.SeriesElements.Add(dimensionElementRow);
olapReport.CategoricalElements.Add(measureElement);
return olapReport;
}

PivotGrid in Tabular model-server mode