■ PivotGridControl 클래스를 사용하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
using System.Windows.Forms; using DevExpress.XtraPivotGrid; PivotGridControl pivotGridControl = new PivotGridControl(); pivotGridControl.Name = "pivotGridControl"; pivotGridControl.Dock = DockStyle.Fill; Controls.Add(pivotGridControl); PivotGridField largeCategoryField = new PivotGridField(); largeCategoryField.Name = "largeCategoryField"; largeCategoryField.Caption = "대분류"; largeCategoryField.FieldName = "LargeCategory"; largeCategoryField.Area = PivotArea.ColumnArea; largeCategoryField.AreaIndex = 0; pivotGridControl.Fields.Add(largeCategoryField); PivotGridField middleCategoryField = new PivotGridField(); middleCategoryField.Name = "middleCategoryField"; middleCategoryField.Caption = "중분류"; middleCategoryField.FieldName = "MiddleCategory"; middleCategoryField.Area = PivotArea.ColumnArea; middleCategoryField.AreaIndex = 1; pivotGridControl.Fields.Add(middleCategoryField); PivotGridField dateField = new PivotGridField(); dateField.Name = "dateField"; dateField.Caption = "일자"; dateField.FieldName = "Date"; dateField.Area = PivotArea.RowArea; dateField.AreaIndex = 0; pivotGridControl.Fields.Add(dateField); PivotGridField amountField = new PivotGridField(); amountField.Name = "amountField"; amountField.Caption = "금액"; amountField.FieldName = "Amount"; amountField.Area = PivotArea.DataArea; amountField.AreaIndex = 0; pivotGridControl.Fields.Add(amountField); |