/// <summary>
        /// String values for result row
        /// </summary>
        /// <param name="dataSourceRow">Data source row</param>
        /// <returns>List of string values for result row</returns>
        public List <string> StringValuesForResultRow(ICrmDataSourceRow dataSourceRow)
        {
            List <object> sourceFields     = this.Result.DetailsFields;
            int           sourceFieldCount = sourceFields.Count;
            List <string> stringArray      = null;

            if (sourceFieldCount > 0)
            {
                stringArray = new List <string>();
                foreach (object field in sourceFields)
                {
                    if (field == null)
                    {
                        stringArray.Add(string.Empty);
                    }
                    else
                    {
                        AnalysisSourceField sourceField = (AnalysisSourceField)field;
                        stringArray.Add(dataSourceRow.ValueAtIndex(sourceField.QueryResultFieldIndex));
                    }
                }
            }

            return(stringArray);
        }
Example #2
0
        /// <inheritdoc/>
        public override List <object> CategoriesForRow(ICrmDataSourceRow row)
        {
            var resultArray         = new List <object>();
            AnalysisCategoryValue v = this.CategoryValueForRow(row);

            if (v != null && !v.IsEmptyValue)
            {
                resultArray.Add(v);
            }

            foreach (var subIndices in this.AnalysisField.SubFieldQueryResultFieldIndices)
            {
                string rawValue = row.RawValueAtIndex(subIndices.ToInt());
                if (rawValue != null)
                {
                    v = this.ValueDictionary.ValueOrDefault(rawValue) as AnalysisCategoryValue;
                    if (v == null)
                    {
                        if (!this.AnalysisField.CrmFieldInfo.IsEmptyValue(rawValue))
                        {
                            v = new AnalysisCategoryValue(this, rawValue, row.ValueAtIndex(subIndices.ToInt()));
                            if (v != null)
                            {
                                this.AddToValueDictionary(v);
                            }
                        }
                    }

                    if (v != null)
                    {
                        resultArray.Add(v);
                    }
                }
            }

            if (resultArray.Count > 0)
            {
                return(resultArray);
            }

            return(new List <object> {
                this.EmptyValue()
            });
        }
Example #3
0
 /// <inheritdoc/>
 public override string TextResultForResultRow(ICrmDataSourceRow row) => row.ValueAtIndex(this.SourceField.QueryResultFieldIndex);
 /// <inheritdoc/>
 public override string StringValueForRow(ICrmDataSourceRow row)
 {
     return(row.ValueAtIndex(this.QueryResultFieldIndex));
 }