Ejemplo n.º 1
0
//        public static void UpdateSummaryType
//            (Dictionary<string, CustomSummaryType> summaryTypes, IAvrPivotGridField field)
//        {
//            CustomSummaryType summaryTypeType =
//                summaryTypes.ContainsKey(
//                    field.FieldName)
//                    ? summaryTypes[field.FieldName]
//                    : field.GetDefaultSummaryType();
//            if (!summaryTypes.ContainsKey(field.FieldName))
//            {
//                summaryTypes.Add(
//                    field.FieldName, summaryTypeType);
//            }
//            else
//                summaryTypes[field.FieldName] = summaryTypeType;
//            PivotSummaryType summaryType = summaryTypeType == CustomSummaryType.Count
//                                               ? PivotSummaryType.Count
//                                               : PivotSummaryType.Custom;
//            field.CustomSummaryType = summaryTypeType;
//            field.SummaryType = summaryType;
//
//
//        }

        private static SearchFieldType GetSearchFieldType(WebPivotGridField webField)
        {
            string fieldName = webField.Name;
            //DataView view = null;
            DataRow fieldRow;
            bool    isLookup;
            int     pos = fieldName.IndexOf("__", StringComparison.Ordinal);

            if (pos > 0)
            {
                string[] fieldParts    = webField.OriginalFieldName.Split(new[] { "__" }, StringSplitOptions.RemoveEmptyEntries);
                int      i             = SearchFieldLookup.Find(fieldParts[0]);
                DataRow  paramRow      = LookupCache.GetLookupRow(webField.OriginalFieldName, LookupTables.ParameterForFFType.ToString());
                object   referenceType = paramRow["idfsReferenceType"];
                isLookup = !bv.common.Core.Utils.IsEmpty(referenceType);
                fieldRow = SearchFieldLookup[i].Row;
            }
            else
            {
                int i = SearchFieldLookup.Find(webField.OriginalFieldName);
                fieldRow = SearchFieldLookup[i].Row;
                isLookup = IsLookupField(fieldRow);
            }
            if (isLookup)
            {
                return(SearchFieldType.ID);
            }
            return((SearchFieldType)fieldRow["idfsSearchFieldType"]);
        }