예제 #1
0
        public override int GetRowsCount(RenderContext context)
        {
            if (context.GroupValues != null)
            {
                if (ColumnAggregateRowsCountHandler != null)
                {
                    return(ColumnAggregateRowsCountHandler(context.Journal, context.GroupValues));
                }
                return(base.GetRowsCount(context));
            }

            context.LoadData(BaseJournalCrossTable);

            if (ColumnRowsCountHandler != null)
            {
                return(ColumnRowsCountHandler(context.GetDataRow <TDataRow>()));
            }

            int count;

            if (ExecuteGetRowsCount(context, out count))
            {
                return(count);
            }

            return(1);
        }
예제 #2
0
 protected virtual TAggregateRow GetAggregateRow(RenderContext context, TRow row)
 {
     CurrentRow = row;
     if (row == null)
     {
         return(null);
     }
     if (CrossTable != null)
     {
         context.LoadData(CrossTable);
         if (CrossTable.RowValues.ContainsKey(row))
         {
             return(CrossTable.RowValues[row]);
         }
         if (CrossTable.CurrentValuesRows != null &&
             CrossTable.CurrentValuesRows.ContainsKey(row) &&
             CrossTable.CurrentValuesRows[row].Count > RowIndex)
         {
             var key = CrossTable.CurrentValuesRows[row][RowIndex];
             return(CrossTable.CurrentValues[row][key]);
         }
         if (CrossTable.RowGroupedValues.ContainsKey(row))
         {
             var rowValues = CrossTable.RowGroupedValues[row];
             if (rowValues.Count > RowIndex)
             {
                 return(rowValues[RowIndex]);
             }
         }
     }
     else if (context != null)
     {
         context.LoadData(BaseCrossTable);
         return((TAggregateRow)BaseCrossTable.GetDataItem(context));
     }
     //Debug.Fail("RowIndex больше чем записей AggregateColumn");
     return(new TAggregateRow());
 }
예제 #3
0
        public override object GetValue(RenderContext context)
        {
            if (context.GroupValues != null)
            {
                if (ColumnAggregateValueHandler != null)
                {
                    return(ColumnAggregateValueHandler(context.CrossColumnId, context.GroupValues));
                }
                return(GetGroupValue(context));
            }

            context.LoadData(BaseJournalCrossTable);

            var row = context.GetDataRow <TDataRow>();

            if (row == null)
            {
                return(null);
            }
            if (GetValueHandler != null && !_executeGetValue)
            {
                _executeGetValue = true;
                try
                {
                    return(GetValueHandler(context));
                }
                finally
                {
                    _executeGetValue = false;
                }
            }
            if (ColumnValueHandler != null)
            {
                return(ColumnValueHandler(row));
            }
            return(base.GetValue(context));
        }
예제 #4
0
        public override int GetRowsCount(RenderContext context)
        {
            if (context.GroupValues != null)
            {
                return(base.GetRowsCount(context));
            }

            int count;

            if (ExecuteGetRowsCount(context, out count))
            {
                return(count);
            }

            var row = context.GetDataRow <TRow>();

            if (CrossTable != null)
            {
                context.LoadData(CrossTable);
                if (CrossTable.RowValues.ContainsKey(row))
                {
                    return(1);
                }
                if (CrossTable.CurrentValuesRows != null && CrossTable.CurrentValuesRows.ContainsKey(row))
                {
                    return(CrossTable.CurrentValuesRows[row].Count);
                }
                return(CrossTable.RowGroupedValues[row].Count);
            }

            if (IsCrossColumn)
            {
                return(BaseCrossTable.GetRowsCount(context));
            }
            return(BaseCrossTable.GetRowsCount(context));
        }