Lets assume a list of data with: Year, Company_name, num_Companies, num_Employes, num_Beds, num_Patients
Now I want to have the Years in the columns and each of the num_... per row showing the sum (for all records)
Therefore set:
pivotGrid.ShowCalculationsAsColumns = false;
And define the columns and rows ...
pivotGrid.PivotColumns.Add(new PivotItem { FieldMappingName = "Year", TotalHeader = "Total" });
pivotGrid.PivotCalculations.Add(new PivotComputationInfo { FieldName = "num_Companies", FieldCaption = "Anzahl Betriebe", SummaryType = SummaryType.Sum });
pivotGrid.PivotCalculations.Add(new PivotComputationInfo { FieldName = "num_Employees", FieldCaption = "Beschäftigte am 31.12", SummaryType = SummaryType.Sum });
pivotGrid.PivotCalculations.Add(new PivotComputationInfo { FieldName = "num_Beds", FieldCaption = "Betten am 1.1", SummaryType = SummaryType.Sum });
pivotGrid.PivotCalculations.Add(new PivotComputationInfo { FieldName = "num_Patients", FieldCaption = "Leistungsempfänger am 31.12", SummaryType = SummaryType.Sum });
Then the 1. column containing the row captions is auto sized, but way to wide. See Attached file:
How can I controll the with of this column ?
Attachment:
Pivotdemo_c020484e.7z