aspnet-115624-aspnet-mvc-extensions-pivot-grid-getting-started-lesson-2-bind-a-pivot-grid-to-an-olap-data-source.md
This topic describes how to connect the PivotGrid extension to an OLAP data source - an Analysis Services server or a local cube file.
To bind the PivotGrid to an OLAP data source, follow the steps below.
Add the PivotGrid extension to your project using the Insert DevExpress MVC Extension Wizard. For this, open a required View file ( Views | Home | Index.cshtml in this topic), right-click the desired location to display the menu, and click Insert DevExpress MVC Extension…
In the invoked dialog, go to the Data tab, select PivotGrid and click Insert. The wizard automatically generates the View code for the extension and inserts it into the View at the cursor position.
In the pivot grid’s generated View code (Views | Home | _PivotGridPartial.cshtml), use the PivotGridExtension.BindToOLAP method with the specified OLAP connection string from the PivotGridOLAPHelper class. This enables binding to an OLAP data source. After that, add and configure pivot grid fields.
Run the project. As a result, you have a fully functional MVC PivotGrid bound to an OLAP cube.