![devexpress pivot grid devexpress pivot grid](https://docs.devexpress.com/WindowsForms/images/pivotgrid_elementssupportingappearances12932.png)
For now, please have a look at the basic pivoting with a simple grid/report control. I may provide many different options to pivot in this article in future. But those samples can easily be derived the same way as it is provided in the previous article. To keep the article simple and due to lack of time, I have not provided many samples in this article. In my previous article, I provided many samples to display data in different pivot forms. I, therefore, decided to write a separate article regarding pivoting the data in ASP.NET MVC. BackgroundĪfter my article, Pivoting DataTable Simplified, I got many email requests from the readers that they wish to Pivot the data in ASP.NET MVC too. I have, therefore, created a simple grid control of my own which renders HTML from the IEnumerable. To display the data in UI, a grid control is also required. This article aims to simplify the process of pivoting of data when you have your IEnumerable in your presentation layer. When you have a large amount of data or you wish to visualize data column wise with logical grouping/aggregation, here is the extension method which will help you. data in a pivot form has become an essential part of reporting now a days. PivotGridField fieldCountry = new PivotGridField()į = PivotFilterType.Included GroupInterval = PivotGroupInterval.DateQuarter, PivotGridField fieldOrderDate2 = new PivotGridField() GroupInterval = PivotGroupInterval.DateYear, PivotGridField fieldOrderDate1 = new PivotGridField() PivotGridField fieldExtendedPrice = new PivotGridField()į = į = "c2" PivotGridField fieldProductName = new PivotGridField() PivotGridField fieldCategoryName = new PivotGridField() Namespace WinFormsPivotGridDataFieldsExampleĮxcelDataSource ds = new ExcelDataSource() ĮxcelWorksheetSettings settings = new ExcelWorksheetSettings("Data") ĭs.SourceOptions = new ExcelSourceOptions(settings)
![devexpress pivot grid devexpress pivot grid](https://demos.devexpress.com/MVC/Content/PivotGrid.png)
The PivotGridControl’s data source is the ExcelDataSource instance, created in code.
![devexpress pivot grid devexpress pivot grid](https://www.devexpress.com/Products/NET/Controls/ASP/Pivot_Grid/media/carousel/aspnet-pivotgrid-sales-viewer.png)
![devexpress pivot grid devexpress pivot grid](https://www.devexpress.com/Products/NET/Controls/WPF/Pivot_Grid/i/reporting-devexpress-wpf-pivotgrid@2x.png)
#Devexpress pivot grid how to#
This example demonstrates how to create the pivot grid fields in code and specify their location and format. Two types of fields are supported: bound fields (which get their data from the data source) and unbound fields (which should be populated manually via the PivotGridControl.CustomUnboundFieldData event). The control’s data source is specified by the PivotGridControl.DataSource and PivotGridControl.DataMember properties. The summary is calculated against a data field and the summary type is specified by the PivotGridFieldBase.SummaryType property of the data field. Consequently, a cell in the Pivot Grid Control represents multiple records and it displays a summary value calculated against these records. Obviously however, multiple records in the control’s data source can have identical values in the specified column field(s) and row field(s). Thus a cell at the intersection of a column and row is identified by a column field value(s) and row field value(s). Similarly, the values of the row fields are listed across the control’s left edge. The fields positioned within these areas are called column fields, row fields, data fields and filter fields, respectively.Ī field is represented by the PivotGridField class.įor column fields, the control lists their values across the top edge. Dragging a field between the areas lets you reorganize the data and present it in various forms. A field is visually represented by a box (field header) which can be dragged between the control’s areas: Column Header Area, Row Header Area, Data Area and Filter Header Area. The following summary functions are supported: Sum, Average, Count, Min, Max, StdDev, StdDevp, StdVar, StdVarp.įields are basic blocks which an end-user can manipulate in the PivotGrid control. It calculates summaries and summary totals against specific fields and displays the summary values within data cells. The Pivot Grid Control represents data from an underlying data source in a cross-tabulated form. The following members accept/return PivotGridControl objects: LibraryįilterPopupExcelParseFilterCriteriaEventArgs.PivotGridįilterPopupExcelQueryFilterCriteriaEventArgs.PivotGrid