static public void LoadXml_FieldProperty(PivotGridControl pivotGrid, DataSet ds) { DataTable dt = ds.Tables[TableName]; foreach (DataRow row in dt.Rows) { string sFieldName = row.GetString(FieldName); if (string.IsNullOrEmpty(sFieldName)) { continue; } //TODO : 확인 필요 PivotGridField field = pivotGrid.Fields.GetFieldByName(PivotGridHelper.GetFieldName(sFieldName)); if (field == null) { continue; } string sAreaPosition = row.GetString(AreaPosition); string sPositionIndex = row.GetString(PositionIndex); string sValuesExcluded = row.GetString(ValuesExcluded); string sSortOrder = row.GetString(SortOrder); string sWidth = row.GetString(Width); string sVisible = row.GetString(Visible); field.SetAreaPosition(ConvertToPivotArea(sAreaPosition), Convert.ToInt32(sPositionIndex)); if (string.IsNullOrEmpty(sValuesExcluded) == false) { field.FilterValues.SetValues(StringToObjects(sValuesExcluded), PivotFilterType.Excluded, true); } field.SortOrder = ConvertToPivotSortOrder(sSortOrder); field.Width = Convert.ToInt32(sWidth); field.Visible = Convert.ToBoolean(sVisible); } }
public static bool AddCustomTotal(PivotGridControl gridControl, string fieldName, PivotSummaryType sType, string tag, FormatType hFormatType, string hFormatString, FormatType cFormatType, string FormatStr) { PivotGridField targetField; try { targetField = gridControl.Fields[fieldName]; } catch { return(false); } if (targetField != null) { PivotGridHelper.AddCustomTotal(targetField, sType, tag, hFormatType, hFormatString, cFormatType, FormatStr); return(true); } return(false); }