Exago Logo
Generic filters
Exact matches only

Custom Aggregate Function: AggConcat()

Review the documentation on Custom Aggregate Functions for full details on developing and implementing this function. This function must be implemented by a system administrator before it can be used in a report.

Description Returns a concatenated string of values separated by a specified delimiter string.
  • dataToAggregate: the value to concatenate, accepts data fields or cell references. Required.
  • delimiter: the string to separate each value with. Optional, defaults to comma and a space if not provided.
  • recordLevel: indicates whether to aggregate by recordLevel (true) or entity level (false). Optional, defaults to true if not provided.
  • WebReports.Api.Common
  • WebReports.Api.Custom
Example AggConcat({Categories.CategoryName}, ":")
Beverages, Condiments, Seafood

Program Code

public class AggJoin : ICustomAggregator
    System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
    string delimiter = ", ";
	public void AddValue(SessionInfo sessionInfo, object value, params object[] args)
        // Skip blank values
	 if (value == null || value.ToString() == string.Empty)
        if (args.Length != 0)
        	this.delimiter = args[0].ToString();

	public object Result(SessionInfo sessionInfo)
        string retVal = this.stringBuilder.ToString();
        // Remove the trailing delimiter
        if (this.delimiter.Length > 0 && retVal.Length > 0)
            retVal = retVal.Remove(retVal.Length - this.delimiter.Length);
        return retVal;
Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents