The OLAP control allows you to directly bind cube data that is created using SSAS (SQL Server Analysis Services). The PivotEngine component of the OLAP control allows you to directly bind cube data with the help of BindCubeService method. This method accepts two parameters; URL (URL of the SSAS server) and Cube (OLAP cube in the SSAS server). The PivotPanel control and PivotGrid control binds to PivotEngine.
Complete the following steps to bind cube data in the OLAP control.
Create a new MVC application using the ComponentOne or VisualStudio templates. For more information about creating an MVC application, see Configuring your MVC Application topic.
To add an OLAP control to the application, follow these steps:
Add a new Controller
CubeController
).CubeController.cs |
Copy Code
|
---|---|
public class CubeController : Controller { // GET: Cube public ActionResult Index() { return View(); } } |
CubeController
.Index()
.Index.cshtml |
Copy Code
|
---|---|
<c1-pivot-engine id="cubeEngine"> <c1-cube-service url="http://ssrs.componentone.com/OLAP/msmdpump.dll" cube="Adventure Works"></c1-cube-service> <c1-view-field-collection c1-property="RowFields" items="[Customer].[Country]"></c1-view-field-collection> <c1-view-field-collection c1-property="ColumnFields" items="[Customer].[Occupation]"></c1-view-field-collection> <c1-view-field-collection c1-property="ValueFields" items="[Measures].[Customer Count]"></c1-view-field-collection> </c1-pivot-engine> <c1-pivot-chart items-source-id="cubeEngine"></c1-pivot-chart> <c1-pivot-grid items-source-id="cubeEngine"></c1-pivot-grid> |