The quick start guides you through the steps of adding an OLAP control in a web application and displaying data in it.
Follow the steps given below to get started:
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.
Back to TopCreate a new class inside the Models folder to create a data source for the OLAP control.
ProductData.cs
). For more information about how to add a new model, see Adding controls.Create a Controller and View for OLAP control and follow the below steps to initialize an OLAP control.
Add a new Controller
OlapController
).OlapController.
Index()
.Razor |
Copy Code
|
---|---|
@model IEnumerable<ProductData> <c1-pivot-engine id="indexEngine"> <c1-items-source source-collection="Model"></c1-items-source> <c1-view-field-collection c1-property="RowFields" items="Country"></c1-view-field-collection> <c1-view-field-collection c1-property="ColumnFields" items="Product"></c1-view-field-collection> <c1-view-field-collection c1-property="ValueFields" items="Sales"></c1-view-field-collection> </c1-pivot-engine> <c1-pivot-panel items-source-id="indexEngine"></c1-pivot-panel> <c1-pivot-chart items-source-id="indexEngine"></c1-pivot-chart> <c1-pivot-grid items-source-id="indexEngine"></c1-pivot-grid> |