Features

DataEngine Service(SSAS)

DataEngine Service(SSAS)

The PivotEngine component binds to a DataEngine Web API and cube data.

Features

Settings

Description

In this sample, the PivotEngine component binds to a service. Here, only the DataEngine Web API is supported,
which is responsible for data aggregation.
The service url should be provided in this mode.
You can get the details about how to deploy the DataEngine service in the DataEngine Web API documentation.

In this sample, the PivotEngine component connects to a cube DataEngine data.
The cube DataEngine data is configurated in the Statup file of the application.
If you want to customize the fields for a cube data, you need to use the AddCubeField method to add a cube field.
The PivotPanel control and the PivotGrid control are bound to the PivotEngine.
You can change the view definition in the PivotPanel control.
The aggregated data will be obtained from the service.
Then the PivotGrid control displays the aggregated data.
You can find the detailed raw data shown in a grid by double-clicking a cell in the PivotGrid control.

When the data row count is greater than 10,000, in order to get good performance, we recommend you deploy a DataEngine Web API and use BindService(url) mode.
Otherwise, please use Bind(data) or Bind(url).

using System.Web.Mvc;

namespace OlapExplorer.Controllers.Olap
{
    partial class OlapController : Controller
    {
        // GET: PivotGrid
        public ActionResult SSAS()
        {
            OlapModel.ControlId = "ssasPanel";
            ViewBag.DemoSettingsModel = OlapModel;
            return View();
        }
    }
}
@using C1.Web.Mvc.Grid
@{
    ClientSettingsModel optionsModel = ViewBag.DemoSettingsModel;
}

@(Html.C1().PivotEngine().Id("ssasEngine")
		.ShowRowTotals(ShowTotals.Subtotals)
		.ShowColumnTotals(ShowTotals.Subtotals)
		.BindService("~/api/dataengine/cube")
		.Fields(pfcb =>
			pfcb.Items(c =>
			{
				c.AddCubeField(fb => fb.Header("Internet Orders")
					.DimensionType(DimensionType.Measure)
					.SubFields(sfsb =>
					{
						sfsb.Add(sfb => sfb.Header("Internet Order Count")
							.Binding("[Measures].[Internet Order Count]")
							.DataType(DataType.Number)
							.DimensionType(DimensionType.Measure));
					})
				);
				c.AddCubeField(fb => fb.Header("Product")
					.DimensionType(DimensionType.Dimension)
					.SubFields(sfsb =>
					{
						sfsb.Add(sfb => sfb.Header("Category")
							.Binding("[Product].[Category]")
							.DataType(DataType.String)
							.DimensionType(DimensionType.Hierarchy)
						);
						sfsb.Add(sfb => sfb.Header("Stocking")
							.DimensionType(DimensionType.Folder)
							.SubFields(sfs =>
							{
								sfs.Add(f => f.Binding("[Product].[Color]")
									.Header("Color")
									.DataType(DataType.String)
									.DimensionType(DimensionType.Hierarchy)
								);
								sfs.Add(f => f.Binding("[Product].[Class]")
									.Header("Class")
									.DataType(DataType.String)
									.DimensionType(DimensionType.Hierarchy)
								);
							})
						);
						sfsb.Add(sfb => sfb.Header("Product")
							.Binding("[Product].[Product]")
							.DataType(DataType.String)
							.DimensionType(DimensionType.Hierarchy)
						);
					}
				));
			}
		))
		.RowFields(rfb => rfb.Items("[Product].[Product]"))
		.ValueFields(vfb => vfb.Items("[Measures].[Internet Order Count]"))
)

<div class="row">
    <div class="col-sm-4 col-md-4">
        @Html.C1().PivotPanel().Id(optionsModel.ControlId).ItemsSourceId("ssasEngine")
    </div>
    <div class="col-sm-8 col-md-8">
        @Html.C1().PivotGrid().Id("indexGrid").ItemsSourceId("ssasEngine")
    </div>
</div>

@section Description{
<p>@Html.Raw(Resources.Olap.SSAS_Text0)</p>

<p>@Html.Raw(Resources.Olap.SSAS_Text1)</p>

<p>@Html.Raw(Resources.Olap.SSAS_Text2)</p>

}
@section Summary{
<p>@Html.Raw(Resources.Olap.SSAS_Text3)</p>

}