PdfRpt.Export.ExportToExcel.setAggregateFunctions C# (CSharp) Method

setAggregateFunctions() private method

private setAggregateFunctions ( ExcelTable tbl ) : void
tbl OfficeOpenXml.Table.ExcelTable
return void
        private void setAggregateFunctions(ExcelTable tbl)
        {
            var idx = 0;
            foreach (var item in _columns)
            {
                idx++;
                if (item.AggregateFunction == null) continue;

                var function = item.AggregateFunction;
                var aggregateFunction = item.AggregateFunction as AggregateProvider;
                if (aggregateFunction != null)
                {
                    function = aggregateFunction.ColumnAggregateFunction;
                }

                var type = function.GetType();
                RowFunctions rowFunction;
                if (_rowFunctions.TryGetValue(type, out rowFunction))
                {
                    if (!tbl.ShowTotal) tbl.ShowTotal = true;
                    tbl.Columns[_uniqueHeaders[idx]].DataCellStyleName = "TableNumber";
                    tbl.Columns[_uniqueHeaders[idx]].TotalsRowFunction = rowFunction;
                    _worksheet.Cells[_row, idx].Style.Numberformat.Format = Numberformat;
                }
            }
        }